Skip to main content

KernelConfigBuilder

Struct KernelConfigBuilder 

Source
pub struct KernelConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> KernelConfigBuilder<S>

Source

pub fn build(self) -> KernelConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn environment( self, value: Environment, ) -> KernelConfigBuilder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). Default: Environment::Backtest.

The kernel environment context.

Source

pub fn maybe_environment( self, value: Option<Environment>, ) -> KernelConfigBuilder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). Default: Environment::Backtest.

The kernel environment context.

Source

pub fn trader_id(self, value: TraderId) -> KernelConfigBuilder<SetTraderId<S>>
where S::TraderId: IsUnset,

Optional (Some / Option setters). Default: <TraderId as Default>::default().

The trader ID for the node (must be a name and ID tag separated by a hyphen).

Source

pub fn maybe_trader_id( self, value: Option<TraderId>, ) -> KernelConfigBuilder<SetTraderId<S>>
where S::TraderId: IsUnset,

Optional (Some / Option setters). Default: <TraderId as Default>::default().

The trader ID for the node (must be a name and ID tag separated by a hyphen).

Source

pub fn load_state(self, value: bool) -> KernelConfigBuilder<SetLoadState<S>>
where S::LoadState: IsUnset,

Optional (Some / Option setters). Default: false.

If trading strategy state should be loaded from the database on start.

Source

pub fn maybe_load_state( self, value: Option<bool>, ) -> KernelConfigBuilder<SetLoadState<S>>
where S::LoadState: IsUnset,

Optional (Some / Option setters). Default: false.

If trading strategy state should be loaded from the database on start.

Source

pub fn save_state(self, value: bool) -> KernelConfigBuilder<SetSaveState<S>>
where S::SaveState: IsUnset,

Optional (Some / Option setters). Default: false.

If trading strategy state should be saved to the database on stop.

Source

pub fn maybe_save_state( self, value: Option<bool>, ) -> KernelConfigBuilder<SetSaveState<S>>
where S::SaveState: IsUnset,

Optional (Some / Option setters). Default: false.

If trading strategy state should be saved to the database on stop.

Source

pub fn logging(self, value: LoggerConfig) -> KernelConfigBuilder<SetLogging<S>>
where S::Logging: IsUnset,

Optional (Some / Option setters). Default: <LoggerConfig as Default>::default().

The logging configuration for the kernel.

Source

pub fn maybe_logging( self, value: Option<LoggerConfig>, ) -> KernelConfigBuilder<SetLogging<S>>
where S::Logging: IsUnset,

Optional (Some / Option setters). Default: <LoggerConfig as Default>::default().

The logging configuration for the kernel.

Source

pub fn instance_id(self, value: UUID4) -> KernelConfigBuilder<SetInstanceId<S>>
where S::InstanceId: IsUnset,

Optional (Some / Option setters). The unique instance identifier for the kernel

Source

pub fn maybe_instance_id( self, value: Option<UUID4>, ) -> KernelConfigBuilder<SetInstanceId<S>>
where S::InstanceId: IsUnset,

Optional (Some / Option setters). The unique instance identifier for the kernel

Source

pub fn timeout_connection( self, value: Duration, ) -> KernelConfigBuilder<SetTimeoutConnection<S>>
where S::TimeoutConnection: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(120).

The timeout for all clients to connect and initialize.

Source

pub fn maybe_timeout_connection( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetTimeoutConnection<S>>
where S::TimeoutConnection: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(120).

The timeout for all clients to connect and initialize.

Source

pub fn timeout_reconciliation( self, value: Duration, ) -> KernelConfigBuilder<SetTimeoutReconciliation<S>>
where S::TimeoutReconciliation: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(30).

The timeout for execution state to reconcile.

Source

pub fn maybe_timeout_reconciliation( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetTimeoutReconciliation<S>>
where S::TimeoutReconciliation: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(30).

The timeout for execution state to reconcile.

Source

pub fn timeout_portfolio( self, value: Duration, ) -> KernelConfigBuilder<SetTimeoutPortfolio<S>>
where S::TimeoutPortfolio: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The timeout for portfolio to initialize margins and unrealized pnls.

Source

pub fn maybe_timeout_portfolio( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetTimeoutPortfolio<S>>
where S::TimeoutPortfolio: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The timeout for portfolio to initialize margins and unrealized pnls.

Source

pub fn timeout_disconnection( self, value: Duration, ) -> KernelConfigBuilder<SetTimeoutDisconnection<S>>
where S::TimeoutDisconnection: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The timeout for all engine clients to disconnect.

Source

pub fn maybe_timeout_disconnection( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetTimeoutDisconnection<S>>
where S::TimeoutDisconnection: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The timeout for all engine clients to disconnect.

Source

pub fn delay_post_stop( self, value: Duration, ) -> KernelConfigBuilder<SetDelayPostStop<S>>
where S::DelayPostStop: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The delay after stopping the node to await residual events before final shutdown.

Source

pub fn maybe_delay_post_stop( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetDelayPostStop<S>>
where S::DelayPostStop: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(10).

The delay after stopping the node to await residual events before final shutdown.

Source

pub fn timeout_shutdown( self, value: Duration, ) -> KernelConfigBuilder<SetTimeoutShutdown<S>>
where S::TimeoutShutdown: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(5).

The delay to await pending tasks cancellation during shutdown.

Source

pub fn maybe_timeout_shutdown( self, value: Option<Duration>, ) -> KernelConfigBuilder<SetTimeoutShutdown<S>>
where S::TimeoutShutdown: IsUnset,

Optional (Some / Option setters). Default: Duration::from_secs(5).

The delay to await pending tasks cancellation during shutdown.

Source

pub fn cache(self, value: CacheConfig) -> KernelConfigBuilder<SetCache<S>>
where S::Cache: IsUnset,

Optional (Some / Option setters). The cache configuration.

Source

pub fn maybe_cache( self, value: Option<CacheConfig>, ) -> KernelConfigBuilder<SetCache<S>>
where S::Cache: IsUnset,

Optional (Some / Option setters). The cache configuration.

Source

pub fn msgbus( self, value: MessageBusConfig, ) -> KernelConfigBuilder<SetMsgbus<S>>
where S::Msgbus: IsUnset,

Optional (Some / Option setters). The message bus configuration.

Source

pub fn maybe_msgbus( self, value: Option<MessageBusConfig>, ) -> KernelConfigBuilder<SetMsgbus<S>>
where S::Msgbus: IsUnset,

Optional (Some / Option setters). The message bus configuration.

Source

pub fn data_engine( self, value: DataEngineConfig, ) -> KernelConfigBuilder<SetDataEngine<S>>
where S::DataEngine: IsUnset,

Optional (Some / Option setters). The data engine configuration.

Source

pub fn maybe_data_engine( self, value: Option<DataEngineConfig>, ) -> KernelConfigBuilder<SetDataEngine<S>>
where S::DataEngine: IsUnset,

Optional (Some / Option setters). The data engine configuration.

Source

pub fn risk_engine( self, value: RiskEngineConfig, ) -> KernelConfigBuilder<SetRiskEngine<S>>
where S::RiskEngine: IsUnset,

Optional (Some / Option setters). The risk engine configuration.

Source

pub fn maybe_risk_engine( self, value: Option<RiskEngineConfig>, ) -> KernelConfigBuilder<SetRiskEngine<S>>
where S::RiskEngine: IsUnset,

Optional (Some / Option setters). The risk engine configuration.

Source

pub fn exec_engine( self, value: ExecutionEngineConfig, ) -> KernelConfigBuilder<SetExecEngine<S>>
where S::ExecEngine: IsUnset,

Optional (Some / Option setters). The execution engine configuration.

Source

pub fn maybe_exec_engine( self, value: Option<ExecutionEngineConfig>, ) -> KernelConfigBuilder<SetExecEngine<S>>
where S::ExecEngine: IsUnset,

Optional (Some / Option setters). The execution engine configuration.

Source

pub fn portfolio( self, value: PortfolioConfig, ) -> KernelConfigBuilder<SetPortfolio<S>>
where S::Portfolio: IsUnset,

Optional (Some / Option setters). The portfolio configuration.

Source

pub fn maybe_portfolio( self, value: Option<PortfolioConfig>, ) -> KernelConfigBuilder<SetPortfolio<S>>
where S::Portfolio: IsUnset,

Optional (Some / Option setters). The portfolio configuration.

Source

pub fn streaming( self, value: StreamingConfig, ) -> KernelConfigBuilder<SetStreaming<S>>
where S::Streaming: IsUnset,

Optional (Some / Option setters). The configuration for streaming to feather files.

Source

pub fn maybe_streaming( self, value: Option<StreamingConfig>, ) -> KernelConfigBuilder<SetStreaming<S>>
where S::Streaming: IsUnset,

Optional (Some / Option setters). The configuration for streaming to feather files.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> Ungil for T
where T: Send,