pub struct WeakLanceCache { /* private fields */ }Expand description
A weak reference to a LanceCache, used by indices to avoid circular references. When the original cache is dropped, operations on this will gracefully no-op.
Implementations§
Source§impl WeakLanceCache
impl WeakLanceCache
pub fn from(cache: &LanceCache) -> Self
pub fn with_key_prefix(&self, prefix: &str) -> Self
pub async fn get_with_key<K>(&self, cache_key: &K) -> Option<Arc<K::ValueType>>
pub async fn insert_with_key<K>( &self, cache_key: &K, value: Arc<K::ValueType>, ) -> bool
Sourcepub async fn get_or_insert_with_key<K, F, Fut>(
&self,
cache_key: K,
loader: F,
) -> Result<Arc<K::ValueType>>
pub async fn get_or_insert_with_key<K, F, Fut>( &self, cache_key: K, loader: F, ) -> Result<Arc<K::ValueType>>
Get or insert an item, computing it if necessary.
Deduplication of concurrent loads is handled by the backend.
pub async fn get_unsized_with_key<K>( &self, cache_key: &K, ) -> Option<Arc<K::ValueType>>
pub async fn insert_unsized_with_key<K>( &self, cache_key: &K, value: Arc<K::ValueType>, )
Trait Implementations§
Source§impl Clone for WeakLanceCache
impl Clone for WeakLanceCache
Source§fn clone(&self) -> WeakLanceCache
fn clone(&self) -> WeakLanceCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeakLanceCache
impl !RefUnwindSafe for WeakLanceCache
impl Send for WeakLanceCache
impl Sync for WeakLanceCache
impl Unpin for WeakLanceCache
impl UnsafeUnpin for WeakLanceCache
impl !UnwindSafe for WeakLanceCache
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