pub struct PriceReminderStateCache { /* private fields */ }Implementations§
Source§impl PriceReminderStateCache
impl PriceReminderStateCache
pub fn new() -> Arc<Self>
pub fn replace_stock(&self, stock_id: u64, items: Vec<PriceReminderCachedItem>)
pub fn replace_stock_at( &self, stock_id: u64, items: Vec<PriceReminderCachedItem>, now: Instant, )
pub fn lookup(&self, stock_id: u64, key: i64) -> PriceReminderItemLookup
pub fn lookup_at( &self, stock_id: u64, key: i64, now: Instant, ) -> PriceReminderItemLookup
pub fn stock_id_for_key(&self, key: i64) -> Option<u64>
Sourcepub fn snapshot_item(
&self,
stock_id: u64,
key: i64,
) -> Option<PriceReminderCachedItem>
pub fn snapshot_item( &self, stock_id: u64, key: i64, ) -> Option<PriceReminderCachedItem>
Read the retained last-good row without changing freshness state.
Runtime write paths must use Self::lookup so dirty data cannot be
mistaken for fresh; this snapshot is for diagnostics and failure tests.
pub fn mark_stock_dirty(&self, stock_id: u64)
pub fn record_server_seq(&self, server_seq: i32)
pub fn handle_change_push( &self, stock_id: i64, server_seq: i32, ) -> PriceReminderChangePushAction
pub fn apply_set_action(&self, action: PriceReminderSetCacheAction)
pub fn apply_set_action_at( &self, action: PriceReminderSetCacheAction, now: Instant, )
pub fn clear_idle_at(&self, now: Instant) -> usize
Trait Implementations§
Source§impl Debug for PriceReminderStateCache
impl Debug for PriceReminderStateCache
Source§impl Default for PriceReminderStateCache
impl Default for PriceReminderStateCache
Source§fn default() -> PriceReminderStateCache
fn default() -> PriceReminderStateCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PriceReminderStateCache
impl !RefUnwindSafe for PriceReminderStateCache
impl Send for PriceReminderStateCache
impl Sync for PriceReminderStateCache
impl Unpin for PriceReminderStateCache
impl UnsafeUnpin for PriceReminderStateCache
impl UnwindSafe for PriceReminderStateCache
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