pub struct OptionContractSpec {
pub underlying_instrument_id: InstrumentId,
pub strike: Price,
pub expiration_ns: UnixNanos,
pub option_kind: OptionKind,
}Expand description
The contract inputs used to compute a candidate option identifier.
Fields§
§underlying_instrument_id: InstrumentIdThe option’s actual underlying, independent of its series reference-price instrument.
strike: PriceThe exact strike price.
expiration_ns: UnixNanosUNIX expiration timestamp in nanoseconds.
option_kind: OptionKindThe option kind.
Implementations§
Source§impl OptionContractSpec
impl OptionContractSpec
Sourcepub const fn new(
underlying_instrument_id: InstrumentId,
strike: Price,
expiration_ns: UnixNanos,
option_kind: OptionKind,
) -> Self
pub const fn new( underlying_instrument_id: InstrumentId, strike: Price, expiration_ns: UnixNanos, option_kind: OptionKind, ) -> Self
Creates a contract specification.
Sourcepub fn from_expiry(
underlying_instrument_id: InstrumentId,
strike: Price,
expiry: &str,
option_kind: OptionKind,
) -> Result<Self, OptionInstrumentIdError>
pub fn from_expiry( underlying_instrument_id: InstrumentId, strike: Price, expiry: &str, option_kind: OptionKind, ) -> Result<Self, OptionInstrumentIdError>
Creates a specification from a UTC expiry date or timestamp string.
§Errors
Returns an error if the expiry cannot be parsed.
Sourcepub fn expiry_date(&self) -> Date
pub fn expiry_date(&self) -> Date
Returns the UTC calendar date of expiration.
Trait Implementations§
Source§impl Clone for OptionContractSpec
impl Clone for OptionContractSpec
impl Copy for OptionContractSpec
Source§impl Debug for OptionContractSpec
impl Debug for OptionContractSpec
impl Eq for OptionContractSpec
Source§impl PartialEq for OptionContractSpec
impl PartialEq for OptionContractSpec
impl StructuralPartialEq for OptionContractSpec
Auto Trait Implementations§
impl Freeze for OptionContractSpec
impl RefUnwindSafe for OptionContractSpec
impl Send for OptionContractSpec
impl Sync for OptionContractSpec
impl Unpin for OptionContractSpec
impl UnsafeUnpin for OptionContractSpec
impl UnwindSafe for OptionContractSpec
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more