pub struct FastCache { /* private fields */ }Implementations§
Source§impl FastCache
The update is slow, but the loading is more than 20 times faster than Moka’s cache.
impl FastCache
The update is slow, but the loading is more than 20 times faster than Moka’s cache.
pub fn new(size: u64, ttl: u64) -> FastCache
Sourcepub fn insert(
&self,
hash: u128,
value: Arc<dyn CacheVal>,
) -> Option<(u128, Arc<dyn CacheVal>)>
pub fn insert( &self, hash: u128, value: Arc<dyn CacheVal>, ) -> Option<(u128, Arc<dyn CacheVal>)>
Insert a value and return evicted data if it has a different hash value than the inserted one.
pub fn get(&self, hash: u128, now: u64, msec: MSec) -> Option<Arc<dyn CacheVal>>
pub fn invalidate(&self, hash: u128)
pub fn invalidate_all_of(&self, type_id: u64)
pub fn invalidate_all(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FastCache
impl !RefUnwindSafe for FastCache
impl !UnwindSafe for FastCache
impl Send for FastCache
impl Sync for FastCache
impl Unpin for FastCache
impl UnsafeUnpin for FastCache
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.