CacheGroup

Struct CacheGroup 

Source
pub struct CacheGroup<'a, B, S, M>{ /* private fields */ }
Expand description

A logical grouping of cache entries with shared namespace and invalidation

Implementations§

Source§

impl<'a, B, S, M> CacheGroup<'a, B, S, M>

Source

pub fn group_key(&self, key: &str) -> String

Get the fully qualified key for this group

Source

pub fn group_tag(&self) -> String

Tag used for invalidation of entire group

Source

pub async fn get<T>(&self, key: impl CacheKey) -> Result<CacheResult<T>>

Get a value from the group

Source

pub async fn set<T>( &self, key: impl CacheKey, value: T, options: impl Into<CacheOptions>, ) -> Result<()>
where T: Serialize,

Set a value in the group

Source

pub async fn delete(&self, key: impl CacheKey) -> Result<bool>

Delete a key from the group

Source§

impl<'a, B, S, M> CacheGroup<'a, B, S, M>

Source

pub async fn invalidate_all(&self) -> Result<u64>

Invalidate all entries in this group

Source

pub async fn keys(&self) -> Result<Vec<String>>

Get all keys in this group

Auto Trait Implementations§

§

impl<'a, B, S, M> Freeze for CacheGroup<'a, B, S, M>

§

impl<'a, B, S, M> !RefUnwindSafe for CacheGroup<'a, B, S, M>

§

impl<'a, B, S, M> Send for CacheGroup<'a, B, S, M>

§

impl<'a, B, S, M> Sync for CacheGroup<'a, B, S, M>

§

impl<'a, B, S, M> Unpin for CacheGroup<'a, B, S, M>

§

impl<'a, B, S, M> !UnwindSafe for CacheGroup<'a, B, S, M>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V