Skip to main content

PortfolioConfigBuilder

Struct PortfolioConfigBuilder 

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

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

Implementations§

Source§

impl<S: State> PortfolioConfigBuilder<S>

Source

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

Finish building and return the requested object

Source

pub fn use_mark_prices( self, value: bool, ) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>
where S::UseMarkPrices: IsUnset,

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

The type of prices used for portfolio calculations, such as unrealized PnLs. If false (default), uses quote prices if available; otherwise, last trade prices (or falls back to bar prices if bar_updates is true). If true, uses mark prices.

Source

pub fn maybe_use_mark_prices( self, value: Option<bool>, ) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>
where S::UseMarkPrices: IsUnset,

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

The type of prices used for portfolio calculations, such as unrealized PnLs. If false (default), uses quote prices if available; otherwise, last trade prices (or falls back to bar prices if bar_updates is true). If true, uses mark prices.

Source

pub fn use_mark_xrates( self, value: bool, ) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>
where S::UseMarkXrates: IsUnset,

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

The type of exchange rates used for portfolio calculations. If false (default), uses quote prices. If true, uses mark prices.

Source

pub fn maybe_use_mark_xrates( self, value: Option<bool>, ) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>
where S::UseMarkXrates: IsUnset,

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

The type of exchange rates used for portfolio calculations. If false (default), uses quote prices. If true, uses mark prices.

Source

pub fn bar_updates( self, value: bool, ) -> PortfolioConfigBuilder<SetBarUpdates<S>>
where S::BarUpdates: IsUnset,

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

If external bars should be considered for updating unrealized PnLs.

Source

pub fn maybe_bar_updates( self, value: Option<bool>, ) -> PortfolioConfigBuilder<SetBarUpdates<S>>
where S::BarUpdates: IsUnset,

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

If external bars should be considered for updating unrealized PnLs.

Source

pub fn convert_to_account_base_currency( self, value: bool, ) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>
where S::ConvertToAccountBaseCurrency: IsUnset,

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

If calculations should be converted into each account’s base currency. This setting is only effective for accounts with a specified base currency.

Source

pub fn maybe_convert_to_account_base_currency( self, value: Option<bool>, ) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>
where S::ConvertToAccountBaseCurrency: IsUnset,

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

If calculations should be converted into each account’s base currency. This setting is only effective for accounts with a specified base currency.

Source

pub fn min_account_state_logging_interval_ms( self, value: u64, ) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>
where S::MinAccountStateLoggingIntervalMs: IsUnset,

Optional (Some / Option setters). The minimum interval (milliseconds) between logging account state events for the same account. When set, account state updates will only be logged if this much time has passed since the last log. Useful for HFT deployments to prevent excessive logging when account states change rapidly.

Source

pub fn maybe_min_account_state_logging_interval_ms( self, value: Option<u64>, ) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>
where S::MinAccountStateLoggingIntervalMs: IsUnset,

Optional (Some / Option setters). The minimum interval (milliseconds) between logging account state events for the same account. When set, account state updates will only be logged if this much time has passed since the last log. Useful for HFT deployments to prevent excessive logging when account states change rapidly.

Source

pub fn debug(self, value: bool) -> PortfolioConfigBuilder<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>, ) -> PortfolioConfigBuilder<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,