pub struct DistributedCache { /* private fields */ }Expand description
Distributed cache coordinator
Implementations§
Source§impl DistributedCache
impl DistributedCache
Sourcepub async fn remove_peer(&self, node_id: &str)
pub async fn remove_peer(&self, node_id: &str)
Remove peer node
Sourcepub async fn get(&self, key: &CacheKey) -> Result<Option<CacheValue>>
pub async fn get(&self, key: &CacheKey) -> Result<Option<CacheValue>>
Get value from distributed cache
Sourcepub async fn put(&self, key: CacheKey, value: CacheValue) -> Result<()>
pub async fn put(&self, key: CacheKey, value: CacheValue) -> Result<()>
Put value into distributed cache
Sourcepub fn is_hot_key(&self, key: &CacheKey) -> bool
pub fn is_hot_key(&self, key: &CacheKey) -> bool
Check if key is hot (frequently accessed)
Sourcepub async fn stats(&self) -> CacheStats
pub async fn stats(&self) -> CacheStats
Get statistics
Auto Trait Implementations§
impl Freeze for DistributedCache
impl !RefUnwindSafe for DistributedCache
impl Send for DistributedCache
impl Sync for DistributedCache
impl Unpin for DistributedCache
impl UnsafeUnpin for DistributedCache
impl !UnwindSafe for DistributedCache
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> 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