pub struct Sharded<T> { /* private fields */ }Expand description
A sharded mutex wrapper for the page caches. Each key routes to one of N
independent shards (each with its own lock), so concurrent rayon workers
probing different keys rarely contend on the same lock. A try_lock that
fails under contention is counted as a try-lock-miss. (§5.8)
Implementations§
Source§impl Sharded<PageCache>
impl Sharded<PageCache>
pub fn stats(&self) -> CacheStats
pub fn reset_stats(&self)
pub fn flush_to_disk(&self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Source§impl Sharded<DecodedPageCache>
impl Sharded<DecodedPageCache>
pub fn stats(&self) -> CacheStats
pub fn reset_stats(&self)
pub fn len(&self) -> usize
Auto Trait Implementations§
impl<T> !Freeze for Sharded<T>
impl<T> !RefUnwindSafe for Sharded<T>
impl<T> Send for Sharded<T>where
T: Send,
impl<T> Sync for Sharded<T>where
T: Send,
impl<T> Unpin for Sharded<T>where
T: Unpin,
impl<T> UnsafeUnpin for Sharded<T>
impl<T> UnwindSafe for Sharded<T>where
T: UnwindSafe,
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