#[non_exhaustive]pub struct OptionContract {Show 15 fields
pub contract_symbol: String,
pub strike: f64,
pub currency: Option<String>,
pub last_price: Option<f64>,
pub change: Option<f64>,
pub percent_change: Option<f64>,
pub volume: Option<i64>,
pub open_interest: Option<i64>,
pub bid: Option<f64>,
pub ask: Option<f64>,
pub contract_size: Option<String>,
pub expiration: Option<i64>,
pub last_trade_date: Option<i64>,
pub implied_volatility: Option<f64>,
pub in_the_money: Option<bool>,
}Expand description
An options contract (call or put)
Note: This struct cannot be manually constructed - obtain via Ticker::options().
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.contract_symbol: StringContract symbol (e.g., “AAPL250117C00150000”)
strike: f64Strike price
currency: Option<String>Contract currency
last_price: Option<f64>Last trade price
change: Option<f64>Price change
percent_change: Option<f64>Percent change
volume: Option<i64>Trading volume
open_interest: Option<i64>Open interest
bid: Option<f64>Bid price
ask: Option<f64>Ask price
contract_size: Option<String>Contract size (usually 100)
expiration: Option<i64>Expiration date (Unix timestamp)
last_trade_date: Option<i64>Last trade date (Unix timestamp)
implied_volatility: Option<f64>Implied volatility
in_the_money: Option<bool>Whether the option is in the money
Implementations§
Source§impl OptionContract
impl OptionContract
Sourcepub fn to_dataframe(&self) -> PolarsResult<DataFrame>
pub fn to_dataframe(&self) -> PolarsResult<DataFrame>
Converts this struct to a single-row polars DataFrame.
All scalar fields are included as columns. Nested objects and complex types are excluded.
This method is auto-generated by the ToDataFrame derive macro.
Sourcepub fn vec_to_dataframe(items: &[Self]) -> PolarsResult<DataFrame>
pub fn vec_to_dataframe(items: &[Self]) -> PolarsResult<DataFrame>
Converts a slice of structs to a multi-row polars DataFrame.
All scalar fields are included as columns. Nested objects and complex types are excluded.
This method is auto-generated by the ToDataFrame derive macro.
Trait Implementations§
Source§impl Clone for OptionContract
impl Clone for OptionContract
Source§fn clone(&self) -> OptionContract
fn clone(&self) -> OptionContract
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptionContract
impl Debug for OptionContract
Source§impl<'de> Deserialize<'de> for OptionContract
impl<'de> Deserialize<'de> for OptionContract
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>,
Auto Trait Implementations§
impl Freeze for OptionContract
impl RefUnwindSafe for OptionContract
impl Send for OptionContract
impl Sync for OptionContract
impl Unpin for OptionContract
impl UnwindSafe for OptionContract
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,
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