pub struct ExactStateCache<E> { /* private fields */ }Implementations§
Source§impl<E: Clone> ExactStateCache<E>
impl<E: Clone> ExactStateCache<E>
pub fn new(max_entries: usize, max_bytes: u64) -> Self
pub fn lookup(&mut self, page_id: &str) -> Option<ExactStateLookup<E>>
pub fn token_counts_at_most(&self, max_token_count: u64) -> Vec<u64>
pub fn record( &mut self, page_id: String, token_count: u64, payload: ExactStatePayload, extra: E, ) -> ExactStateRecordOutcome
pub fn stats(&self) -> ExactStateCacheStats
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for ExactStateCache<E>
impl<E> RefUnwindSafe for ExactStateCache<E>where
E: RefUnwindSafe,
impl<E> Send for ExactStateCache<E>where
E: Send,
impl<E> Sync for ExactStateCache<E>where
E: Sync,
impl<E> Unpin for ExactStateCache<E>where
E: Unpin,
impl<E> UnsafeUnpin for ExactStateCache<E>
impl<E> UnwindSafe for ExactStateCache<E>where
E: UnwindSafe,
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