pub struct DerivativeTickerCache { /* private fields */ }Expand description
Caches last-emitted derivative ticker values per instrument to suppress duplicates when the exchange re-sends unchanged fields.
Implementations§
Source§impl DerivativeTickerCache
impl DerivativeTickerCache
Sourcepub fn should_emit_funding_rate(&mut self, update: &FundingRateUpdate) -> bool
pub fn should_emit_funding_rate(&mut self, update: &FundingRateUpdate) -> bool
Returns true if the funding rate changed (or is new) and should be emitted.
Sourcepub fn should_emit_mark_price(&mut self, update: &MarkPriceUpdate) -> bool
pub fn should_emit_mark_price(&mut self, update: &MarkPriceUpdate) -> bool
Returns true if the mark price changed (or is new) and should be emitted.
Sourcepub fn should_emit_index_price(&mut self, update: &IndexPriceUpdate) -> bool
pub fn should_emit_index_price(&mut self, update: &IndexPriceUpdate) -> bool
Returns true if the index price changed (or is new) and should be emitted.
Trait Implementations§
Source§impl Debug for DerivativeTickerCache
impl Debug for DerivativeTickerCache
Source§impl Default for DerivativeTickerCache
impl Default for DerivativeTickerCache
Source§fn default() -> DerivativeTickerCache
fn default() -> DerivativeTickerCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DerivativeTickerCache
impl RefUnwindSafe for DerivativeTickerCache
impl Send for DerivativeTickerCache
impl Sync for DerivativeTickerCache
impl Unpin for DerivativeTickerCache
impl UnsafeUnpin for DerivativeTickerCache
impl UnwindSafe for DerivativeTickerCache
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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