pub struct LoadingCache { /* private fields */ }Expand description
Loading cache
Implementations§
Source§impl LoadingCache
impl LoadingCache
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), MLError>
Sourcepub fn put_entry(&mut self, entry: CacheEntry)
pub fn put_entry(&mut self, entry: CacheEntry)
Insert or replace a cache entry by id.
Sourcepub fn get_entry(&mut self, entry_id: &str) -> Option<CacheEntry>
pub fn get_entry(&mut self, entry_id: &str) -> Option<CacheEntry>
Retrieve a cache entry by id, incrementing its access count and updating the last-accessed timestamp.
Sourcepub fn remove_entry(&mut self, entry_id: &str) -> bool
pub fn remove_entry(&mut self, entry_id: &str) -> bool
Remove a cache entry by id. Returns true if an entry was removed.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Number of entries currently held in the cache.
Sourcepub fn cache_policy(&self) -> &CachePolicy
pub fn cache_policy(&self) -> &CachePolicy
Return a reference to the cache policy.
Sourcepub fn cache_stats(&self) -> &CacheStats
pub fn cache_stats(&self) -> &CacheStats
Return a reference to the cache statistics.
Auto Trait Implementations§
impl Freeze for LoadingCache
impl RefUnwindSafe for LoadingCache
impl Send for LoadingCache
impl Sync for LoadingCache
impl Unpin for LoadingCache
impl UnsafeUnpin for LoadingCache
impl UnwindSafe for LoadingCache
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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