pub struct BlobCache { /* private fields */ }Expand description
Cache for individual function blobs, keyed by content hash.
Implementations§
Source§impl BlobCache
impl BlobCache
Sourcepub fn memory_only() -> Self
pub fn memory_only() -> Self
Create a memory-only cache.
Sourcepub fn has_blob(&self, hash: &FunctionHash) -> bool
pub fn has_blob(&self, hash: &FunctionHash) -> bool
Check if a blob is cached.
Sourcepub fn get_blob(&mut self, hash: &FunctionHash) -> Option<FunctionBlob>
pub fn get_blob(&mut self, hash: &FunctionHash) -> Option<FunctionBlob>
Get a cached blob by hash.
Sourcepub fn put_blob(&mut self, blob: &FunctionBlob)
pub fn put_blob(&mut self, blob: &FunctionBlob)
Store a blob in the cache.
Sourcepub fn stats(&self) -> &CacheStats
pub fn stats(&self) -> &CacheStats
Get cache statistics.
Sourcepub fn clear_memory(&mut self)
pub fn clear_memory(&mut self)
Clear the in-memory cache.
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Number of blobs in memory cache.
Auto Trait Implementations§
impl Freeze for BlobCache
impl RefUnwindSafe for BlobCache
impl Send for BlobCache
impl Sync for BlobCache
impl Unpin for BlobCache
impl UnsafeUnpin for BlobCache
impl UnwindSafe for BlobCache
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> 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