pub struct OptionExposureHandle(/* private fields */);Expand description
The latest exposure for one query, independent of egui. Clones share the subscription; dropping the last handle makes its sink inactive.
Implementations§
Source§impl OptionExposureHandle
impl OptionExposureHandle
Sourcepub fn new(
feed: &dyn Datafeed,
query: OptionExposureQuery,
wake: impl Fn() + Send + Sync + 'static,
) -> Option<Self>
pub fn new( feed: &dyn Datafeed, query: OptionExposureQuery, wake: impl Fn() + Send + Sync + 'static, ) -> Option<Self>
Subscribe outside egui closures, waking the host on every snapshot or error.
Returns None for an empty symbol or reversed expiry range. Unsupported feeds report
FeedError::NotSupported through Self::error, leaving gamma fallback available.
Sourcepub fn snapshot(&self) -> Option<Arc<OptionExposure>>
pub fn snapshot(&self) -> Option<Arc<OptionExposure>>
Latest accepted snapshot, exactly as delivered, or None until one arrives.
Sourcepub fn snapshot_or_gamma(
&self,
quotes: &[OptionQuote],
) -> Result<Option<Arc<OptionExposure>>, FeedError>
pub fn snapshot_or_gamma( &self, quotes: &[OptionQuote], ) -> Result<Option<Arc<OptionExposure>>, FeedError>
Prefer a supplied snapshot, including one with no rows, over computed gamma.
Before one arrives, compute gamma from quotes within the query’s expiry range.
Supply quotes for this underlying and, for historical requests, the requested instant.
Other exposure kinds have no local fallback. Never adds computed and supplied values.
Trait Implementations§
Source§impl Clone for OptionExposureHandle
impl Clone for OptionExposureHandle
Source§fn clone(&self) -> OptionExposureHandle
fn clone(&self) -> OptionExposureHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OptionExposureHandle
impl !UnwindSafe for OptionExposureHandle
impl Freeze for OptionExposureHandle
impl Send for OptionExposureHandle
impl Sync for OptionExposureHandle
impl Unpin for OptionExposureHandle
impl UnsafeUnpin for OptionExposureHandle
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
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,
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