pub struct OptionContractKey {
pub contract_instrument: Option<Instrument>,
pub underlying: Instrument,
pub side: OptionSide,
pub strike: Price,
pub expiration_date: NaiveDate,
}Expand description
Identity of an option contract.
The required fields form the option’s economic key. When
contract_instrument is present, it participates in equality and hashing so
adjusted contracts, venue-specific listings, and other distinct listed
contracts with the same economic terms do not collapse to the same key.
Without a contract instrument this remains an economic key, not a guaranteed
unique listed-contract identity.
Fields§
§contract_instrument: Option<Instrument>Provider or venue instrument identifier for the option contract, when known.
underlying: InstrumentUnderlying instrument the option is written on.
side: OptionSideCall or put side of the option contract.
strike: PriceStrike price of the contract.
expiration_date: NaiveDateCanonical expiration calendar date.
Implementations§
Source§impl OptionContractKey
impl OptionContractKey
Sourcepub const fn new(
underlying: Instrument,
side: OptionSide,
strike: Price,
expiration_date: NaiveDate,
) -> OptionContractKey
pub const fn new( underlying: Instrument, side: OptionSide, strike: Price, expiration_date: NaiveDate, ) -> OptionContractKey
Build an option contract key from its required economic fields.
Sourcepub fn with_contract_instrument(
self,
contract_instrument: Instrument,
) -> OptionContractKey
pub fn with_contract_instrument( self, contract_instrument: Instrument, ) -> OptionContractKey
Add the listed contract instrument identifier to this key.
Trait Implementations§
Source§impl Clone for OptionContractKey
impl Clone for OptionContractKey
Source§fn clone(&self) -> OptionContractKey
fn clone(&self) -> OptionContractKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Columnar for OptionContractKey
impl Columnar for OptionContractKey
Source§fn columnar_to_dataframe(
items: &[OptionContractKey],
) -> Result<DataFrame, PolarsError>
fn columnar_to_dataframe( items: &[OptionContractKey], ) -> Result<DataFrame, PolarsError>
Source§fn columnar_from_refs(
items: &[&OptionContractKey],
) -> Result<DataFrame, PolarsError>
fn columnar_from_refs( items: &[&OptionContractKey], ) -> Result<DataFrame, PolarsError>
Source§impl Debug for OptionContractKey
impl Debug for OptionContractKey
Source§impl<'de> Deserialize<'de> for OptionContractKey
impl<'de> Deserialize<'de> for OptionContractKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OptionContractKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OptionContractKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for OptionContractKey
Source§impl Hash for OptionContractKey
impl Hash for OptionContractKey
Source§impl PartialEq for OptionContractKey
impl PartialEq for OptionContractKey
Source§impl Serialize for OptionContractKey
impl Serialize for OptionContractKey
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for OptionContractKey
Source§impl ToDataFrame for OptionContractKey
impl ToDataFrame for OptionContractKey
Source§fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
fn to_dataframe(&self) -> Result<DataFrame, PolarsError>
Source§fn empty_dataframe() -> Result<DataFrame, PolarsError>
fn empty_dataframe() -> Result<DataFrame, PolarsError>
Auto Trait Implementations§
impl Freeze for OptionContractKey
impl RefUnwindSafe for OptionContractKey
impl Send for OptionContractKey
impl Sync for OptionContractKey
impl Unpin for OptionContractKey
impl UnsafeUnpin for OptionContractKey
impl UnwindSafe for OptionContractKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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