pub struct RiShardedLock<K, V> { /* private fields */ }Implementations§
Source§impl<K, V> RiShardedLock<K, V>
impl<K, V> RiShardedLock<K, V>
pub fn new(shard_count: usize) -> Self
pub fn with_default_shards() -> Self
pub async fn insert(&self, key: K, value: V) -> Option<V>
pub async fn get<Q>(&self, key: &Q) -> Option<V>
pub async fn get_mut<F, R, Q>(&self, key: &Q, f: F) -> Option<R>
pub async fn remove<Q>(&self, key: &Q) -> Option<V>
pub async fn contains_key<Q>(&self, key: &Q) -> bool
pub async fn len(&self) -> usize
pub async fn is_empty(&self) -> bool
pub async fn clear(&self)
pub async fn retain<F>(&self, f: F)
pub async fn for_each<F>(&self, f: F)
pub async fn for_each_mut<F>(&self, f: F)
pub async fn collect_all(&self) -> HashMap<K, V>
pub async fn collect_where<F>(&self, predicate: F) -> Vec<V>
pub async fn count_where<F>(&self, predicate: F) -> usize
pub async fn remove_where<F>(&self, predicate: F) -> usize
pub async fn update<F, R>(&self, key: &K, f: F) -> Option<R>
pub async fn get_or_insert<F>(&self, key: K, default: F) -> Vwhere
F: FnOnce() -> V,
pub async fn get_or_insert_with_key<F>(&self, key: K, default: F) -> V
pub fn shard_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for RiShardedLock<K, V>
impl<K, V> !RefUnwindSafe for RiShardedLock<K, V>
impl<K, V> Send for RiShardedLock<K, V>
impl<K, V> Sync for RiShardedLock<K, V>
impl<K, V> Unpin for RiShardedLock<K, V>
impl<K, V> UnsafeUnpin for RiShardedLock<K, V>
impl<K, V> !UnwindSafe for RiShardedLock<K, V>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§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::RequestSource§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