pub struct ChunkCache { /* private fields */ }Expand description
LRU cache for decompressed chunks.
Thread-safe via parking_lot::Mutex (non-poisoning). Values are
Arc<Vec<u8>> so multiple readers can share the same decompressed chunk data.
Implementations§
Source§impl ChunkCache
impl ChunkCache
Sourcepub fn new(max_bytes: usize, max_slots: usize) -> Self
pub fn new(max_bytes: usize, max_slots: usize) -> Self
Create a new chunk cache.
max_bytes: maximum total bytes of decompressed data to cache (default 64 MiB)max_slots: maximum number of entries (default 521)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChunkCache
impl !RefUnwindSafe for ChunkCache
impl Send for ChunkCache
impl Sync for ChunkCache
impl Unpin for ChunkCache
impl UnsafeUnpin for ChunkCache
impl UnwindSafe for ChunkCache
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