pub struct Cache { /* private fields */ }Implementations§
Source§impl Cache
impl Cache
pub async fn connect() -> Result<Self, CacheError>
pub async fn connect_named(name: &str) -> Result<Self, CacheError>
pub async fn get(&mut self, key: &str) -> Result<Option<Vec<u8>>, CacheError>
pub async fn get_many<S>( &mut self, keys: &[S], ) -> Result<BTreeMap<String, Vec<u8>>, CacheError>
pub async fn set( &mut self, key: &str, value: &[u8], options: CacheSetOptions, ) -> Result<(), CacheError>
pub async fn set_many( &mut self, entries: &[CacheEntry], options: CacheSetOptions, ) -> Result<(), CacheError>
pub async fn delete(&mut self, key: &str) -> Result<bool, CacheError>
pub async fn delete_many<S>(&mut self, keys: &[S]) -> Result<i64, CacheError>
pub async fn touch( &mut self, key: &str, ttl: Duration, ) -> Result<bool, CacheError>
Auto Trait Implementations§
impl !Freeze for Cache
impl !RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
impl !UnwindSafe for Cache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request