Skip to main content

ExecutionEngineConfigBuilder

Struct ExecutionEngineConfigBuilder 

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

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

Implementations§

Source§

impl<S: State> ExecutionEngineConfigBuilder<S>

Source

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

Finish building and return the requested object

Source

pub fn load_cache( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetLoadCache<S>>
where S::LoadCache: IsUnset,

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

If the cache should be loaded on initialization.

Source

pub fn maybe_load_cache( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetLoadCache<S>>
where S::LoadCache: IsUnset,

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

If the cache should be loaded on initialization.

Source

pub fn manage_own_order_books( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetManageOwnOrderBooks<S>>
where S::ManageOwnOrderBooks: IsUnset,

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

If the execution engine should maintain own/user order books based on commands and events.

Source

pub fn maybe_manage_own_order_books( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetManageOwnOrderBooks<S>>
where S::ManageOwnOrderBooks: IsUnset,

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

If the execution engine should maintain own/user order books based on commands and events.

Source

pub fn snapshot_orders( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetSnapshotOrders<S>>
where S::SnapshotOrders: IsUnset,

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

If order state snapshot lists are persisted to a backing database. Snapshots will be taken at every order state update (when events are applied).

Source

pub fn maybe_snapshot_orders( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetSnapshotOrders<S>>
where S::SnapshotOrders: IsUnset,

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

If order state snapshot lists are persisted to a backing database. Snapshots will be taken at every order state update (when events are applied).

Source

pub fn snapshot_positions( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetSnapshotPositions<S>>
where S::SnapshotPositions: IsUnset,

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

If position state snapshot lists are persisted to a backing database. Snapshots will be taken at position opened, changed and closed (when events are applied).

Source

pub fn maybe_snapshot_positions( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetSnapshotPositions<S>>
where S::SnapshotPositions: IsUnset,

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

If position state snapshot lists are persisted to a backing database. Snapshots will be taken at position opened, changed and closed (when events are applied).

Source

pub fn snapshot_positions_interval_secs( self, value: f64, ) -> ExecutionEngineConfigBuilder<SetSnapshotPositionsIntervalSecs<S>>
where S::SnapshotPositionsIntervalSecs: IsUnset,

Optional (Some / Option setters). The interval (seconds) at which additional position state snapshots are persisted. If None then no additional snapshots will be taken.

Source

pub fn maybe_snapshot_positions_interval_secs( self, value: Option<f64>, ) -> ExecutionEngineConfigBuilder<SetSnapshotPositionsIntervalSecs<S>>
where S::SnapshotPositionsIntervalSecs: IsUnset,

Optional (Some / Option setters). The interval (seconds) at which additional position state snapshots are persisted. If None then no additional snapshots will be taken.

Source

pub fn allow_overfills( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetAllowOverfills<S>>
where S::AllowOverfills: IsUnset,

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

If order fills exceeding order quantity are allowed (logs warning instead of raising). Useful when position reconciliation races with exchange fill events.

Source

pub fn maybe_allow_overfills( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetAllowOverfills<S>>
where S::AllowOverfills: IsUnset,

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

If order fills exceeding order quantity are allowed (logs warning instead of raising). Useful when position reconciliation races with exchange fill events.

Source

pub fn external_clients( self, value: Vec<ClientId>, ) -> ExecutionEngineConfigBuilder<SetExternalClients<S>>
where S::ExternalClients: IsUnset,

Optional (Some / Option setters). The client IDs declared for external stream processing.

The execution engine will not attempt to send trading commands to these client IDs, assuming an external process will consume the serialized command messages from the bus and handle execution.

Source

pub fn maybe_external_clients( self, value: Option<Vec<ClientId>>, ) -> ExecutionEngineConfigBuilder<SetExternalClients<S>>
where S::ExternalClients: IsUnset,

Optional (Some / Option setters). The client IDs declared for external stream processing.

The execution engine will not attempt to send trading commands to these client IDs, assuming an external process will consume the serialized command messages from the bus and handle execution.

Source

pub fn purge_closed_orders_interval_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedOrdersIntervalMins<S>>
where S::PurgeClosedOrdersIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging closed orders from the in-memory cache.

Source

pub fn maybe_purge_closed_orders_interval_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedOrdersIntervalMins<S>>
where S::PurgeClosedOrdersIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging closed orders from the in-memory cache.

Source

pub fn purge_closed_orders_buffer_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedOrdersBufferMins<S>>
where S::PurgeClosedOrdersBufferMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before closed orders can be purged.

Source

pub fn maybe_purge_closed_orders_buffer_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedOrdersBufferMins<S>>
where S::PurgeClosedOrdersBufferMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before closed orders can be purged.

Source

pub fn purge_closed_positions_interval_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedPositionsIntervalMins<S>>
where S::PurgeClosedPositionsIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging closed positions from the in-memory cache.

Source

pub fn maybe_purge_closed_positions_interval_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedPositionsIntervalMins<S>>
where S::PurgeClosedPositionsIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging closed positions from the in-memory cache.

Source

pub fn purge_closed_positions_buffer_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedPositionsBufferMins<S>>
where S::PurgeClosedPositionsBufferMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before closed positions can be purged.

Source

pub fn maybe_purge_closed_positions_buffer_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeClosedPositionsBufferMins<S>>
where S::PurgeClosedPositionsBufferMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before closed positions can be purged.

Source

pub fn purge_account_events_interval_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeAccountEventsIntervalMins<S>>
where S::PurgeAccountEventsIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging account events from the in-memory cache.

Source

pub fn maybe_purge_account_events_interval_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeAccountEventsIntervalMins<S>>
where S::PurgeAccountEventsIntervalMins: IsUnset,

Optional (Some / Option setters). The interval (minutes) between purging account events from the in-memory cache.

Source

pub fn purge_account_events_lookback_mins( self, value: u32, ) -> ExecutionEngineConfigBuilder<SetPurgeAccountEventsLookbackMins<S>>
where S::PurgeAccountEventsLookbackMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before account events can be purged.

Source

pub fn maybe_purge_account_events_lookback_mins( self, value: Option<u32>, ) -> ExecutionEngineConfigBuilder<SetPurgeAccountEventsLookbackMins<S>>
where S::PurgeAccountEventsLookbackMins: IsUnset,

Optional (Some / Option setters). The time buffer (minutes) before account events can be purged.

Source

pub fn purge_from_database( self, value: bool, ) -> ExecutionEngineConfigBuilder<SetPurgeFromDatabase<S>>
where S::PurgeFromDatabase: IsUnset,

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

If purge operations should also delete from the backing database.

Source

pub fn maybe_purge_from_database( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetPurgeFromDatabase<S>>
where S::PurgeFromDatabase: IsUnset,

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

If purge operations should also delete from the backing database.

Source

pub fn debug(self, value: bool) -> ExecutionEngineConfigBuilder<SetDebug<S>>
where S::Debug: IsUnset,

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

If debug mode is active (will provide extra debug logging).

Source

pub fn maybe_debug( self, value: Option<bool>, ) -> ExecutionEngineConfigBuilder<SetDebug<S>>
where S::Debug: IsUnset,

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

If debug mode is active (will provide extra debug logging).

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
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<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,