pub struct LanceCache { /* private fields */ }
Implementations§
Source§impl LanceCache
impl LanceCache
pub fn with_capacity(capacity: usize) -> Self
pub fn no_cache() -> Self
Sourcepub fn with_key_prefix(&self, prefix: &str) -> Self
pub fn with_key_prefix(&self, prefix: &str) -> Self
Appends a prefix to the cache key
If this cache already has a prefix, the new prefix will be appended to the existing one.
Prefixes are used to create a namespace for the cache keys to avoid collisions between different caches.
Sourcepub fn invalidate_prefix(&self, prefix: &str)
pub fn invalidate_prefix(&self, prefix: &str)
Invalidate all entries in the cache that start with the given prefix
The given prefix is appended to the existing prefix of the cache. If you want to invalidate all at the current prefix, pass an empty string.
pub async fn size(&self) -> usize
pub fn approx_size(&self) -> usize
pub async fn size_bytes(&self) -> usize
pub fn approx_size_bytes(&self) -> usize
pub async fn insert_unsized<T: DeepSizeOf + Send + Sync + 'static + ?Sized>( &self, key: &str, metadata: Arc<T>, )
pub async fn get_unsized<T: DeepSizeOf + Send + Sync + 'static + ?Sized>( &self, key: &str, ) -> Option<Arc<T>>
pub async fn stats(&self) -> CacheStats
pub async fn clear(&self)
pub async fn insert_with_key<K>( &self, cache_key: &K, metadata: Arc<K::ValueType>, )
pub async fn get_with_key<K>(&self, cache_key: &K) -> Option<Arc<K::ValueType>>
pub async fn get_or_insert_with_key<K, F, Fut>( &self, cache_key: K, loader: F, ) -> Result<Arc<K::ValueType>>
pub async fn insert_unsized_with_key<K>( &self, cache_key: &K, metadata: Arc<K::ValueType>, )
pub async fn get_unsized_with_key<K>( &self, cache_key: &K, ) -> Option<Arc<K::ValueType>>
Trait Implementations§
Source§impl Clone for LanceCache
impl Clone for LanceCache
Source§fn clone(&self) -> LanceCache
fn clone(&self) -> LanceCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LanceCache
impl Debug for LanceCache
Source§impl DeepSizeOf for LanceCache
impl DeepSizeOf for LanceCache
Source§fn deep_size_of_children(&self, _: &mut Context) -> usize
fn deep_size_of_children(&self, _: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
Auto Trait Implementations§
impl Freeze for LanceCache
impl !RefUnwindSafe for LanceCache
impl Send for LanceCache
impl Sync for LanceCache
impl Unpin for LanceCache
impl !UnwindSafe for LanceCache
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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