Skip to main content

SandboxExecutionClientConfigBuilder

Struct SandboxExecutionClientConfigBuilder 

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

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

Implementations§

Source§

impl<S: State> SandboxExecutionClientConfigBuilder<S>

Source

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

Finish building and return the requested object

Source

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

Optional (Some / Option setters). Default: TraderId::from("SANDBOX-001").

The trader ID for this client.

Source

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

Optional (Some / Option setters). Default: TraderId::from("SANDBOX-001").

The trader ID for this client.

Source

pub fn account_id( self, value: AccountId, ) -> SandboxExecutionClientConfigBuilder<SetAccountId<S>>
where S::AccountId: IsUnset,

Optional (Some / Option setters). Default: AccountId::from("SANDBOX-001").

The account ID for this client.

Source

pub fn maybe_account_id( self, value: Option<AccountId>, ) -> SandboxExecutionClientConfigBuilder<SetAccountId<S>>
where S::AccountId: IsUnset,

Optional (Some / Option setters). Default: AccountId::from("SANDBOX-001").

The account ID for this client.

Source

pub fn venue( self, value: Venue, ) -> SandboxExecutionClientConfigBuilder<SetVenue<S>>
where S::Venue: IsUnset,

Optional (Some / Option setters). Default: Venue::new("SANDBOX").

The venue for this sandbox execution client.

Source

pub fn maybe_venue( self, value: Option<Venue>, ) -> SandboxExecutionClientConfigBuilder<SetVenue<S>>
where S::Venue: IsUnset,

Optional (Some / Option setters). Default: Venue::new("SANDBOX").

The venue for this sandbox execution client.

Source

pub fn starting_balances( self, value: Vec<Money>, ) -> SandboxExecutionClientConfigBuilder<SetStartingBalances<S>>
where S::StartingBalances: IsUnset,

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

The starting balances for this sandbox venue.

Source

pub fn maybe_starting_balances( self, value: Option<Vec<Money>>, ) -> SandboxExecutionClientConfigBuilder<SetStartingBalances<S>>
where S::StartingBalances: IsUnset,

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

The starting balances for this sandbox venue.

Source

pub fn base_currency( self, value: Currency, ) -> SandboxExecutionClientConfigBuilder<SetBaseCurrency<S>>
where S::BaseCurrency: IsUnset,

Optional (Some / Option setters). The base currency for this venue (None for multi-currency).

Source

pub fn maybe_base_currency( self, value: Option<Currency>, ) -> SandboxExecutionClientConfigBuilder<SetBaseCurrency<S>>
where S::BaseCurrency: IsUnset,

Optional (Some / Option setters). The base currency for this venue (None for multi-currency).

Source

pub fn oms_type( self, value: OmsType, ) -> SandboxExecutionClientConfigBuilder<SetOmsType<S>>
where S::OmsType: IsUnset,

Optional (Some / Option setters). Default: OmsType::Netting.

The order management system type used by the exchange.

Source

pub fn maybe_oms_type( self, value: Option<OmsType>, ) -> SandboxExecutionClientConfigBuilder<SetOmsType<S>>
where S::OmsType: IsUnset,

Optional (Some / Option setters). Default: OmsType::Netting.

The order management system type used by the exchange.

Source

pub fn account_type( self, value: AccountType, ) -> SandboxExecutionClientConfigBuilder<SetAccountType<S>>
where S::AccountType: IsUnset,

Optional (Some / Option setters). Default: AccountType::Margin.

The account type for the client.

Source

pub fn maybe_account_type( self, value: Option<AccountType>, ) -> SandboxExecutionClientConfigBuilder<SetAccountType<S>>
where S::AccountType: IsUnset,

Optional (Some / Option setters). Default: AccountType::Margin.

The account type for the client.

Source

pub fn default_leverage( self, value: Decimal, ) -> SandboxExecutionClientConfigBuilder<SetDefaultLeverage<S>>
where S::DefaultLeverage: IsUnset,

Optional (Some / Option setters). Default: Decimal::ONE.

The account default leverage (for margin accounts).

Source

pub fn maybe_default_leverage( self, value: Option<Decimal>, ) -> SandboxExecutionClientConfigBuilder<SetDefaultLeverage<S>>
where S::DefaultLeverage: IsUnset,

Optional (Some / Option setters). Default: Decimal::ONE.

The account default leverage (for margin accounts).

Source

pub fn leverages( self, value: AHashMap<InstrumentId, Decimal>, ) -> SandboxExecutionClientConfigBuilder<SetLeverages<S>>
where S::Leverages: IsUnset,

Optional (Some / Option setters). Default: <AHashMap<InstrumentId, Decimal> as Default>::default().

Per-instrument leverage overrides.

Source

pub fn maybe_leverages( self, value: Option<AHashMap<InstrumentId, Decimal>>, ) -> SandboxExecutionClientConfigBuilder<SetLeverages<S>>
where S::Leverages: IsUnset,

Optional (Some / Option setters). Default: <AHashMap<InstrumentId, Decimal> as Default>::default().

Per-instrument leverage overrides.

Source

pub fn book_type( self, value: BookType, ) -> SandboxExecutionClientConfigBuilder<SetBookType<S>>
where S::BookType: IsUnset,

Optional (Some / Option setters). Default: BookType::L1_MBP.

The order book type for the matching engine.

Source

pub fn maybe_book_type( self, value: Option<BookType>, ) -> SandboxExecutionClientConfigBuilder<SetBookType<S>>
where S::BookType: IsUnset,

Optional (Some / Option setters). Default: BookType::L1_MBP.

The order book type for the matching engine.

Source

pub fn frozen_account( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetFrozenAccount<S>>
where S::FrozenAccount: IsUnset,

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

If True, account balances won’t change (frozen).

Source

pub fn maybe_frozen_account( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetFrozenAccount<S>>
where S::FrozenAccount: IsUnset,

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

If True, account balances won’t change (frozen).

Source

pub fn bar_execution( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetBarExecution<S>>
where S::BarExecution: IsUnset,

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

If bars should be processed by the matching engine (and move the market).

Source

pub fn maybe_bar_execution( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetBarExecution<S>>
where S::BarExecution: IsUnset,

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

If bars should be processed by the matching engine (and move the market).

Source

pub fn trade_execution( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetTradeExecution<S>>
where S::TradeExecution: IsUnset,

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

If trades should be processed by the matching engine (and move the market).

Source

pub fn maybe_trade_execution( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetTradeExecution<S>>
where S::TradeExecution: IsUnset,

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

If trades should be processed by the matching engine (and move the market).

Source

pub fn reject_stop_orders( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetRejectStopOrders<S>>
where S::RejectStopOrders: IsUnset,

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

If stop orders are rejected on submission if trigger price is in the market.

Source

pub fn maybe_reject_stop_orders( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetRejectStopOrders<S>>
where S::RejectStopOrders: IsUnset,

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

If stop orders are rejected on submission if trigger price is in the market.

Source

pub fn support_gtd_orders( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetSupportGtdOrders<S>>
where S::SupportGtdOrders: IsUnset,

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

If orders with GTD time in force will be supported by the venue.

Source

pub fn maybe_support_gtd_orders( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetSupportGtdOrders<S>>
where S::SupportGtdOrders: IsUnset,

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

If orders with GTD time in force will be supported by the venue.

Source

pub fn support_contingent_orders( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetSupportContingentOrders<S>>
where S::SupportContingentOrders: IsUnset,

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

If contingent orders will be supported/respected by the venue.

Source

pub fn maybe_support_contingent_orders( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetSupportContingentOrders<S>>
where S::SupportContingentOrders: IsUnset,

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

If contingent orders will be supported/respected by the venue.

Source

pub fn use_position_ids( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetUsePositionIds<S>>
where S::UsePositionIds: IsUnset,

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

If venue position IDs will be generated on order fills.

Source

pub fn maybe_use_position_ids( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetUsePositionIds<S>>
where S::UsePositionIds: IsUnset,

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

If venue position IDs will be generated on order fills.

Source

pub fn use_random_ids( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetUseRandomIds<S>>
where S::UseRandomIds: IsUnset,

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

If venue order IDs and position IDs will be random UUID4’s. Trade IDs are always deterministic and not affected by this flag.

Source

pub fn maybe_use_random_ids( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetUseRandomIds<S>>
where S::UseRandomIds: IsUnset,

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

If venue order IDs and position IDs will be random UUID4’s. Trade IDs are always deterministic and not affected by this flag.

Source

pub fn use_reduce_only( self, value: bool, ) -> SandboxExecutionClientConfigBuilder<SetUseReduceOnly<S>>
where S::UseReduceOnly: IsUnset,

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

If the reduce_only execution instruction on orders will be honored.

Source

pub fn maybe_use_reduce_only( self, value: Option<bool>, ) -> SandboxExecutionClientConfigBuilder<SetUseReduceOnly<S>>
where S::UseReduceOnly: IsUnset,

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

If the reduce_only execution instruction on orders will be honored.

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,