pub struct ExcSymbol(/* private fields */);Expand description
The exc format symbol.
Implementations§
Source§impl ExcSymbol
impl ExcSymbol
Sourcepub fn futures(base: &Asset, quote: &Asset, date: Date) -> Option<ExcSymbol>
pub fn futures(base: &Asset, quote: &Asset, date: Date) -> Option<ExcSymbol>
Create a symbol for futures.
Return None if date cannot be parsed by the date format.
Sourcepub fn futures_with_str(
base: &Asset,
quote: &Asset,
date: &str,
) -> Option<ExcSymbol>
pub fn futures_with_str( base: &Asset, quote: &Asset, date: &str, ) -> Option<ExcSymbol>
Create a symbol for futures with the given date in string.
Return None if date cannot be parsed by the date format.
Sourcepub fn put(
base: &Asset,
quote: &Asset,
date: Date,
price: Decimal,
) -> Option<ExcSymbol>
pub fn put( base: &Asset, quote: &Asset, date: Date, price: Decimal, ) -> Option<ExcSymbol>
Create a symbol for put options.
Return None if date cannot be parsed by the date format.
Sourcepub fn call(
base: &Asset,
quote: &Asset,
date: Date,
price: Decimal,
) -> Option<ExcSymbol>
pub fn call( base: &Asset, quote: &Asset, date: Date, price: Decimal, ) -> Option<ExcSymbol>
Create a symbol for call options.
Return None if date cannot be parsed by the date format.
Sourcepub fn put_with_str(
base: &Asset,
quote: &Asset,
date: &str,
price: &str,
) -> Option<ExcSymbol>
pub fn put_with_str( base: &Asset, quote: &Asset, date: &str, price: &str, ) -> Option<ExcSymbol>
Create a symbol for put options.
Return None if date cannot be parsed by the date format.
Sourcepub fn call_with_str(
base: &Asset,
quote: &Asset,
date: &str,
price: &str,
) -> Option<ExcSymbol>
pub fn call_with_str( base: &Asset, quote: &Asset, date: &str, price: &str, ) -> Option<ExcSymbol>
Create a symbol for call options.
Return None if date cannot be parsed by the date format.
Sourcepub fn from_symbol(symbol: &Symbol) -> Option<ExcSymbol>
pub fn from_symbol(symbol: &Symbol) -> Option<ExcSymbol>
From symbol.
Sourcepub fn to_parts(&self) -> (Asset, Asset, SymbolType)
pub fn to_parts(&self) -> (Asset, Asset, SymbolType)
Divide symbol into parts: (base, quote, type).
Sourcepub fn to_instrument(&self) -> Instrument
pub fn to_instrument(&self) -> Instrument
Create a Instrument from ExcSymbol.
Trait Implementations§
Source§impl Ord for ExcSymbol
impl Ord for ExcSymbol
Source§impl PartialOrd for ExcSymbol
impl PartialOrd for ExcSymbol
impl Eq for ExcSymbol
impl StructuralPartialEq for ExcSymbol
Auto Trait Implementations§
impl Freeze for ExcSymbol
impl RefUnwindSafe for ExcSymbol
impl Send for ExcSymbol
impl Sync for ExcSymbol
impl Unpin for ExcSymbol
impl UnwindSafe for ExcSymbol
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