pub struct RunCurrencyPlan { /* private fields */ }Expand description
Immutable, validated currency handoff for one backtest run.
Implementations§
Source§impl RunCurrencyPlan
impl RunCurrencyPlan
Sourcepub fn new(
account_currency: impl Into<String>,
primary_symbols: BTreeSet<String>,
conversion_symbols: BTreeSet<String>,
pnl_currency_by_primary_symbol: BTreeMap<String, String>,
conversion_route_by_source_currency: BTreeMap<String, ConversionRoute>,
strict_before_warmup_quotes: Vec<PriceQuote>,
) -> Result<Self, RunCurrencyPlanError>
pub fn new( account_currency: impl Into<String>, primary_symbols: BTreeSet<String>, conversion_symbols: BTreeSet<String>, pnl_currency_by_primary_symbol: BTreeMap<String, String>, conversion_route_by_source_currency: BTreeMap<String, ConversionRoute>, strict_before_warmup_quotes: Vec<PriceQuote>, ) -> Result<Self, RunCurrencyPlanError>
Construct and validate an immutable run currency plan.
pub fn account_currency(&self) -> &str
pub fn primary_symbols(&self) -> &BTreeSet<String>
pub fn conversion_symbols(&self) -> &BTreeSet<String>
pub fn pnl_currency_by_primary_symbol(&self) -> &BTreeMap<String, String>
pub fn conversion_route_by_source_currency( &self, ) -> &BTreeMap<String, ConversionRoute>
pub fn strict_before_warmup_quotes(&self) -> &[PriceQuote]
pub fn pnl_currency_for_primary_symbol( &self, primary_symbol: &str, ) -> Option<&str>
Sourcepub fn route_for_primary_symbol(
&self,
primary_symbol: &str,
) -> Option<&ConversionRoute>
pub fn route_for_primary_symbol( &self, primary_symbol: &str, ) -> Option<&ConversionRoute>
Get the conversion route selected for a primary symbol’s P&L currency.
Sourcepub fn route_symbols(&self) -> BTreeSet<&str>
pub fn route_symbols(&self) -> BTreeSet<&str>
Enumerate all distinct route symbols in canonical order.
Trait Implementations§
Source§impl Clone for RunCurrencyPlan
impl Clone for RunCurrencyPlan
Source§fn clone(&self) -> RunCurrencyPlan
fn clone(&self) -> RunCurrencyPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunCurrencyPlan
impl Debug for RunCurrencyPlan
Source§impl<'de> Deserialize<'de> for RunCurrencyPlan
impl<'de> Deserialize<'de> for RunCurrencyPlan
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RunCurrencyPlan
impl PartialEq for RunCurrencyPlan
Auto Trait Implementations§
impl Freeze for RunCurrencyPlan
impl RefUnwindSafe for RunCurrencyPlan
impl Send for RunCurrencyPlan
impl Sync for RunCurrencyPlan
impl Unpin for RunCurrencyPlan
impl UnsafeUnpin for RunCurrencyPlan
impl UnwindSafe for RunCurrencyPlan
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
Mutably borrows from an owned value. Read more