pub struct NautilusKernel {Show 15 fields
pub name: String,
pub instance_id: UUID4,
pub machine_id: String,
pub config: Box<dyn NautilusKernelConfig>,
pub cache: Rc<RefCell<Cache>>,
pub clock: Rc<RefCell<dyn Clock>>,
pub portfolio: Portfolio,
pub log_guard: LogGuard,
pub data_engine: Rc<RefCell<DataEngine>>,
pub risk_engine: RiskEngine,
pub exec_engine: ExecutionEngine,
pub trader: Trader,
pub ts_created: UnixNanos,
pub ts_started: Option<UnixNanos>,
pub ts_shutdown: Option<UnixNanos>,
}
Expand description
Core Nautilus system kernel.
Orchestrates data and execution engines, cache, clock, and messaging across environments.
Fields§
§name: String
The kernel name (for logging and identification).
instance_id: UUID4
The unique instance identifier for this kernel.
machine_id: String
The machine identifier (hostname or similar).
config: Box<dyn NautilusKernelConfig>
The kernel configuration.
cache: Rc<RefCell<Cache>>
The shared in-memory cache.
clock: Rc<RefCell<dyn Clock>>
The clock driving the kernel.
portfolio: Portfolio
The portfolio manager.
log_guard: LogGuard
Guard for the logging subsystem (keeps logger thread alive).
data_engine: Rc<RefCell<DataEngine>>
The data engine instance.
risk_engine: RiskEngine
The risk engine instance.
exec_engine: ExecutionEngine
The execution engine instance.
trader: Trader
The trader component.
ts_created: UnixNanos
The UNIX timestamp (nanoseconds) when the kernel was created.
ts_started: Option<UnixNanos>
The UNIX timestamp (nanoseconds) when the kernel was last started.
ts_shutdown: Option<UnixNanos>
The UNIX timestamp (nanoseconds) when the kernel was last shutdown.
Implementations§
Source§impl NautilusKernel
impl NautilusKernel
Sourcepub const fn builder(
name: String,
trader_id: TraderId,
environment: Environment,
) -> NautilusKernelBuilder
pub const fn builder( name: String, trader_id: TraderId, environment: Environment, ) -> NautilusKernelBuilder
Create a new NautilusKernelBuilder
for fluent configuration.
Sourcepub fn new<T: NautilusKernelConfig + 'static>(
name: String,
config: T,
) -> Result<Self>
pub fn new<T: NautilusKernelConfig + 'static>( name: String, config: T, ) -> Result<Self>
pub fn generate_timestamp_ns(&self) -> UnixNanos
Sourcepub fn environment(&self) -> Environment
pub fn environment(&self) -> Environment
Returns the kernel’s environment context (Backtest, Sandbox, Live).
Sourcepub fn machine_id(&self) -> &str
pub fn machine_id(&self) -> &str
Returns the kernel’s machine ID.
Sourcepub const fn instance_id(&self) -> UUID4
pub const fn instance_id(&self) -> UUID4
Returns the kernel’s instance ID.
Sourcepub const fn ts_created(&self) -> UnixNanos
pub const fn ts_created(&self) -> UnixNanos
Returns the UNIX timestamp (ns) when the kernel was created.
Sourcepub const fn ts_started(&self) -> Option<UnixNanos>
pub const fn ts_started(&self) -> Option<UnixNanos>
Returns the UNIX timestamp (ns) when the kernel was last started.
Sourcepub const fn ts_shutdown(&self) -> Option<UnixNanos>
pub const fn ts_shutdown(&self) -> Option<UnixNanos>
Returns the UNIX timestamp (ns) when the kernel was last shutdown.
Sourcepub fn load_state(&self) -> bool
pub fn load_state(&self) -> bool
Returns whether the kernel has been configured to load state.
Sourcepub fn save_state(&self) -> bool
pub fn save_state(&self) -> bool
Returns whether the kernel has been configured to save state.
Sourcepub fn msgbus(&self) -> Rc<RefCell<MessageBus>>
pub fn msgbus(&self) -> Rc<RefCell<MessageBus>>
Returns the kernel’s message bus. // TODO: TBD if this is necessary
Sourcepub fn data_engine(&self) -> Ref<'_, DataEngine>
pub fn data_engine(&self) -> Ref<'_, DataEngine>
Returns the kernel’s data engine.
Sourcepub const fn risk_engine(&self) -> &RiskEngine
pub const fn risk_engine(&self) -> &RiskEngine
Returns the kernel’s risk engine.
Sourcepub const fn exec_engine(&self) -> &ExecutionEngine
pub const fn exec_engine(&self) -> &ExecutionEngine
Returns the kernel’s execution engine.
Sourcepub async fn start_async(&mut self)
pub async fn start_async(&mut self)
Starts the Nautilus system kernel.
Sourcepub async fn stop_async(&mut self)
pub async fn stop_async(&mut self)
Stops the Nautilus system kernel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NautilusKernel
impl !RefUnwindSafe for NautilusKernel
impl !Send for NautilusKernel
impl !Sync for NautilusKernel
impl Unpin for NautilusKernel
impl !UnwindSafe for NautilusKernel
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