Skip to main content

CacheManager

Struct CacheManager 

Source
pub struct CacheManager<E>
where E: AsyncExecutor,
{ /* private fields */ }

Implementations§

Source§

impl<E> CacheManager<E>
where E: AsyncExecutor + 'static,

Source

pub fn new(async_executor: E, config: CacheManagerConfig) -> Self

Source

pub fn register<I, T>(&mut self, input_validator: I, task_processor: T)
where I: InputValidator + 'static, T: CacheTaskProcessor + 'static,

Source

pub fn sender(&self) -> Sender<CacheTask>

Source

pub fn start(&mut self)

Source

pub fn init(&self, cache_id: &'static str) -> Result<(), ManualOperationError>

Source

pub fn stop(&self, cache_id: &'static str) -> Result<(), ManualOperationError>

Source

pub fn flush_all( &self, cache_id: &'static str, ) -> Result<(), ManualOperationError>

Source

pub fn force_expiration<K>( &self, cache_id: &'static str, key: K, ) -> Result<(), ManualOperationError>
where K: Send + ToString + 'static,

Source

pub fn invalidate_with_properties<K, V>( &self, cache_id: &'static str, key: K, value: V, ) -> Result<(), ManualOperationError>
where K: Send + ToString + 'static, V: Send + 'static,

Source

pub fn invalidate<K>( &self, expires_in: u64, cache_id: &'static str, key: K, ) -> Result<(), ManualOperationError>
where K: Send + ToString + 'static,

Source

pub fn cache_ids(&self) -> Iter<'_, &'static str>

Source

pub fn statistics(&self) -> &Arc<CacheManagerStatistics>

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for CacheManager<E>

§

impl<E> !Sync for CacheManager<E>

§

impl<E> !UnwindSafe for CacheManager<E>

§

impl<E> Freeze for CacheManager<E>
where E: Freeze,

§

impl<E> Send for CacheManager<E>

§

impl<E> Unpin for CacheManager<E>
where E: Unpin, <E as AsyncExecutor>::Task: Unpin,

§

impl<E> UnsafeUnpin for CacheManager<E>
where E: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.