pub enum InstrumentAny {
Show 18 variants
Betting(BettingInstrument),
BinaryOption(BinaryOption),
Cfd(Cfd),
Commodity(Commodity),
CryptoFuture(CryptoFuture),
CryptoFuturesSpread(CryptoFuturesSpread),
CryptoOption(CryptoOption),
CryptoOptionSpread(CryptoOptionSpread),
CryptoPerpetual(CryptoPerpetual),
CurrencyPair(CurrencyPair),
Equity(Equity),
FuturesContract(FuturesContract),
FuturesSpread(FuturesSpread),
IndexInstrument(IndexInstrument),
OptionContract(OptionContract),
OptionSpread(OptionSpread),
PerpetualContract(PerpetualContract),
TokenizedAsset(TokenizedAsset),
}Variants§
Betting(BettingInstrument)
BinaryOption(BinaryOption)
Cfd(Cfd)
Commodity(Commodity)
CryptoFuture(CryptoFuture)
CryptoFuturesSpread(CryptoFuturesSpread)
CryptoOption(CryptoOption)
CryptoOptionSpread(CryptoOptionSpread)
CryptoPerpetual(CryptoPerpetual)
CurrencyPair(CurrencyPair)
Equity(Equity)
FuturesContract(FuturesContract)
FuturesSpread(FuturesSpread)
IndexInstrument(IndexInstrument)
OptionContract(OptionContract)
OptionSpread(OptionSpread)
PerpetualContract(PerpetualContract)
TokenizedAsset(TokenizedAsset)
Implementations§
Trait Implementations§
Source§impl CatalogPathPrefix for InstrumentAny
impl CatalogPathPrefix for InstrumentAny
Source§fn path_prefix() -> &'static str
fn path_prefix() -> &'static str
Source§impl Clone for InstrumentAny
impl Clone for InstrumentAny
Source§fn clone(&self) -> InstrumentAny
fn clone(&self) -> InstrumentAny
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstrumentAny
impl Debug for InstrumentAny
Source§impl<'de> Deserialize<'de> for InstrumentAny
impl<'de> Deserialize<'de> for InstrumentAny
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>,
Source§impl From<BettingInstrument> for InstrumentAny
impl From<BettingInstrument> for InstrumentAny
Source§fn from(v: BettingInstrument) -> InstrumentAny
fn from(v: BettingInstrument) -> InstrumentAny
Source§impl From<BinaryOption> for InstrumentAny
impl From<BinaryOption> for InstrumentAny
Source§fn from(v: BinaryOption) -> InstrumentAny
fn from(v: BinaryOption) -> InstrumentAny
Source§impl From<Cfd> for InstrumentAny
impl From<Cfd> for InstrumentAny
Source§fn from(v: Cfd) -> InstrumentAny
fn from(v: Cfd) -> InstrumentAny
Source§impl From<Commodity> for InstrumentAny
impl From<Commodity> for InstrumentAny
Source§fn from(v: Commodity) -> InstrumentAny
fn from(v: Commodity) -> InstrumentAny
Source§impl From<CryptoFuture> for InstrumentAny
impl From<CryptoFuture> for InstrumentAny
Source§fn from(v: CryptoFuture) -> InstrumentAny
fn from(v: CryptoFuture) -> InstrumentAny
Source§impl From<CryptoFuturesSpread> for InstrumentAny
impl From<CryptoFuturesSpread> for InstrumentAny
Source§fn from(v: CryptoFuturesSpread) -> InstrumentAny
fn from(v: CryptoFuturesSpread) -> InstrumentAny
Source§impl From<CryptoOption> for InstrumentAny
impl From<CryptoOption> for InstrumentAny
Source§fn from(v: CryptoOption) -> InstrumentAny
fn from(v: CryptoOption) -> InstrumentAny
Source§impl From<CryptoOptionSpread> for InstrumentAny
impl From<CryptoOptionSpread> for InstrumentAny
Source§fn from(v: CryptoOptionSpread) -> InstrumentAny
fn from(v: CryptoOptionSpread) -> InstrumentAny
Source§impl From<CryptoPerpetual> for InstrumentAny
impl From<CryptoPerpetual> for InstrumentAny
Source§fn from(v: CryptoPerpetual) -> InstrumentAny
fn from(v: CryptoPerpetual) -> InstrumentAny
Source§impl From<CurrencyPair> for InstrumentAny
impl From<CurrencyPair> for InstrumentAny
Source§fn from(v: CurrencyPair) -> InstrumentAny
fn from(v: CurrencyPair) -> InstrumentAny
Source§impl From<Equity> for InstrumentAny
impl From<Equity> for InstrumentAny
Source§fn from(v: Equity) -> InstrumentAny
fn from(v: Equity) -> InstrumentAny
Source§impl From<FuturesContract> for InstrumentAny
impl From<FuturesContract> for InstrumentAny
Source§fn from(v: FuturesContract) -> InstrumentAny
fn from(v: FuturesContract) -> InstrumentAny
Source§impl From<FuturesSpread> for InstrumentAny
impl From<FuturesSpread> for InstrumentAny
Source§fn from(v: FuturesSpread) -> InstrumentAny
fn from(v: FuturesSpread) -> InstrumentAny
Source§impl From<IndexInstrument> for InstrumentAny
impl From<IndexInstrument> for InstrumentAny
Source§fn from(v: IndexInstrument) -> InstrumentAny
fn from(v: IndexInstrument) -> InstrumentAny
Source§impl From<OptionContract> for InstrumentAny
impl From<OptionContract> for InstrumentAny
Source§fn from(v: OptionContract) -> InstrumentAny
fn from(v: OptionContract) -> InstrumentAny
Source§impl From<OptionSpread> for InstrumentAny
impl From<OptionSpread> for InstrumentAny
Source§fn from(v: OptionSpread) -> InstrumentAny
fn from(v: OptionSpread) -> InstrumentAny
Source§impl From<PerpetualContract> for InstrumentAny
impl From<PerpetualContract> for InstrumentAny
Source§fn from(v: PerpetualContract) -> InstrumentAny
fn from(v: PerpetualContract) -> InstrumentAny
Source§impl From<Pool> for InstrumentAny
impl From<Pool> for InstrumentAny
Source§impl From<TokenizedAsset> for InstrumentAny
impl From<TokenizedAsset> for InstrumentAny
Source§fn from(v: TokenizedAsset) -> InstrumentAny
fn from(v: TokenizedAsset) -> InstrumentAny
Source§impl HasTsInit for InstrumentAny
impl HasTsInit for InstrumentAny
Source§impl Instrument for InstrumentAny
impl Instrument for InstrumentAny
Source§fn cost_currency(&self) -> Currency
fn cost_currency(&self) -> Currency
§Panics
Panics if the instrument is inverse and does not have a base currency.
Source§fn try_make_price(&self, __enum_dispatch_arg_0: f64) -> Result<Price>
fn try_make_price(&self, __enum_dispatch_arg_0: f64) -> Result<Price>
§Errors
Returns an error if the value is not finite, not representable as a Decimal, or cannot
be converted to a Price.
Source§fn make_price(&self, __enum_dispatch_arg_0: f64) -> Price
fn make_price(&self, __enum_dispatch_arg_0: f64) -> Price
§Panics
Panics if the value cannot be converted to a Price (see try_make_price).
Source§fn try_normalize_price(
&self,
__enum_dispatch_arg_0: Price,
) -> CorrectnessResult<Price>
fn try_normalize_price( &self, __enum_dispatch_arg_0: Price, ) -> CorrectnessResult<Price>
Returns price rebuilt with the instrument precision when it is on the price grid.
§Errors
Returns an error when price is a sentinel value or would require rounding.
Source§fn try_make_qty(
&self,
__enum_dispatch_arg_0: f64,
__enum_dispatch_arg_1: Option<bool>,
) -> Result<Quantity>
fn try_make_qty( &self, __enum_dispatch_arg_0: f64, __enum_dispatch_arg_1: Option<bool>, ) -> Result<Quantity>
§Errors
Returns an error if the value is not finite, not representable as a Decimal, rounds to
zero, or cannot be converted to a Quantity.
Source§fn make_qty(
&self,
__enum_dispatch_arg_0: f64,
__enum_dispatch_arg_1: Option<bool>,
) -> Quantity
fn make_qty( &self, __enum_dispatch_arg_0: f64, __enum_dispatch_arg_1: Option<bool>, ) -> Quantity
§Panics
Panics if the value cannot be converted to a Quantity (see try_make_qty).
Source§fn try_normalize_qty(
&self,
__enum_dispatch_arg_0: Quantity,
) -> CorrectnessResult<Quantity>
fn try_normalize_qty( &self, __enum_dispatch_arg_0: Quantity, ) -> CorrectnessResult<Quantity>
Returns quantity rebuilt with the instrument precision when it is on the size grid.
§Errors
Returns an error when quantity is undefined or would require rounding.
Source§fn try_calculate_base_quantity(
&self,
__enum_dispatch_arg_0: Quantity,
__enum_dispatch_arg_1: Price,
) -> Result<Quantity>
fn try_calculate_base_quantity( &self, __enum_dispatch_arg_0: Quantity, __enum_dispatch_arg_1: Price, ) -> Result<Quantity>
§Errors
Returns an error if last_price is zero, or if the value cannot be converted to a
Quantity.
Source§fn calculate_base_quantity(
&self,
__enum_dispatch_arg_0: Quantity,
__enum_dispatch_arg_1: Price,
) -> Quantity
fn calculate_base_quantity( &self, __enum_dispatch_arg_0: Quantity, __enum_dispatch_arg_1: Price, ) -> Quantity
§Panics
Panics if last_price is zero, or if the value cannot be converted to a Quantity
(see try_calculate_base_quantity).
Source§fn calculate_notional_value(
&self,
__enum_dispatch_arg_0: Quantity,
__enum_dispatch_arg_1: Price,
__enum_dispatch_arg_2: Option<bool>,
) -> Money
fn calculate_notional_value( &self, __enum_dispatch_arg_0: Quantity, __enum_dispatch_arg_1: Price, __enum_dispatch_arg_2: Option<bool>, ) -> Money
§Panics
Panics if the instrument is inverse and does not have a base currency, if the
instrument is inverse and price is zero, or if the notional amount cannot be
represented as Money.