pub struct LiveNode { /* private fields */ }
Expand description
High-level abstraction for a live Nautilus system node.
Provides a simplified interface for running live systems with automatic client management and lifecycle handling.
Implementations§
Source§impl LiveNode
impl LiveNode
Sourcepub fn handle(&self) -> LiveNodeHandle
pub fn handle(&self) -> LiveNodeHandle
Returns a thread-safe handle to control this node.
Sourcepub fn builder(
name: String,
trader_id: TraderId,
environment: Environment,
) -> Result<LiveNodeBuilder>
pub fn builder( name: String, trader_id: TraderId, environment: Environment, ) -> Result<LiveNodeBuilder>
Creates a new LiveNodeBuilder
for fluent configuration.
§Errors
Returns an error if the environment is invalid for live trading.
Sourcepub fn build(name: String, config: Option<LiveNodeConfig>) -> Result<Self>
pub fn build(name: String, config: Option<LiveNodeConfig>) -> Result<Self>
Creates a new LiveNode
directly from a kernel name and optional configuration.
This is a convenience method for creating a live node with a pre-configured kernel configuration, bypassing the builder pattern. If no config is provided, a default configuration will be used.
§Errors
Returns an error if kernel construction fails.
Sourcepub async fn run(&mut self) -> Result<()>
pub async fn run(&mut self) -> Result<()>
Run the live node with automatic shutdown handling.
This method will start the node, run indefinitely, and handle graceful shutdown on interrupt signals.
§Errors
Returns an error if the node fails to start or encounters a runtime error.
Sourcepub fn environment(&self) -> Environment
pub fn environment(&self) -> Environment
Gets the node’s environment.
Sourcepub const fn kernel(&self) -> &NautilusKernel
pub const fn kernel(&self) -> &NautilusKernel
Gets a reference to the underlying kernel.
Sourcepub const fn instance_id(&self) -> UUID4
pub const fn instance_id(&self) -> UUID4
Gets the node’s instance ID.
Sourcepub const fn is_running(&self) -> bool
pub const fn is_running(&self) -> bool
Checks if the live node is currently running.
Sourcepub fn add_actor<T>(&mut self, actor: T) -> Result<()>
pub fn add_actor<T>(&mut self, actor: T) -> Result<()>
Adds an actor to the trader.
This method provides a high-level interface for adding actors to the underlying trader without requiring direct access to the kernel. Actors should be added after the node is built but before starting the node.
§Errors
Returns an error if:
- The trader is not in a valid state for adding components.
- An actor with the same ID is already registered.
- The node is currently running.
Sourcepub fn add_actor_from_factory<F, T>(&mut self, factory: F) -> Result<()>
pub fn add_actor_from_factory<F, T>(&mut self, factory: F) -> Result<()>
Adds an actor to the live node using a factory function.
The factory function is called at registration time to create the actor, avoiding cloning issues with non-cloneable actor types.
§Errors
Returns an error if:
- The node is currently running.
- The factory function fails to create the actor.
- The underlying trader registration fails.
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for LiveNode
impl<'py> IntoPyObject<'py> for LiveNode
Source§impl PyClassImpl for LiveNode
impl PyClassImpl for LiveNode
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§type ThreadChecker = ThreadCheckerImpl
type ThreadChecker = ThreadCheckerImpl
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<LiveNode> for PyClassImplCollector<LiveNode>
impl PyMethods<LiveNode> for PyClassImplCollector<LiveNode>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for LiveNode
impl PyTypeInfo for LiveNode
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.impl DerefToPyAny for LiveNode
Auto Trait Implementations§
impl Freeze for LiveNode
impl !RefUnwindSafe for LiveNode
impl !Send for LiveNode
impl !Sync for LiveNode
impl Unpin for LiveNode
impl !UnwindSafe for LiveNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self
into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self
into a Python object. Read more