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
Sourcepub async fn get_resident_with_key<K>(
&self,
cache_key: &K,
) -> Option<Arc<K::ValueType>>
pub async fn get_resident_with_key<K>( &self, cache_key: &K, ) -> Option<Arc<K::ValueType>>
Read RAM only, avoiding whole-entry promotion for candidate range reads.
Sourcepub async fn peek_resident_with_key<K: CacheKey>(&self, cache_key: &K) -> bool
pub async fn peek_resident_with_key<K: CacheKey>(&self, cache_key: &K) -> bool
Report residency without counting as an access; a dropped cache holds nothing.
Sourcepub async fn peek_tier_with_key<K: CacheKey>(&self, cache_key: &K) -> CacheTier
pub async fn peek_tier_with_key<K: CacheKey>(&self, cache_key: &K) -> CacheTier
Predict the serving tier without counting as an access; a dropped cache holds nothing.
Sourcepub fn plane_admission_gated(&self) -> bool
pub fn plane_admission_gated(&self) -> bool
Whether lower layered planes gate RAM admission; a dropped cache keeps the default.
Sourcepub async fn get_without_promotion_with_key<K>(
&self,
cache_key: &K,
) -> Option<Arc<K::ValueType>>
pub async fn get_without_promotion_with_key<K>( &self, cache_key: &K, ) -> Option<Arc<K::ValueType>>
Read a cached candidate plane without whole-entry RAM admission.
Sourcepub async fn get_rows_with_key<K>(
&self,
cache_key: &K,
rows: &[u32],
) -> Option<Arc<K::ValueType>>
pub async fn get_rows_with_key<K>( &self, cache_key: &K, rows: &[u32], ) -> Option<Arc<K::ValueType>>
Read selected cached rows without promoting a whole plane.
Sourcepub fn capacity_bytes(&self) -> Option<usize>
pub fn capacity_bytes(&self) -> Option<usize>
Weighted capacity in bytes, if the cache is alive and its backend reports one.
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.
Sourcepub async fn get_or_insert_with_key_hit<K, F, Fut>(
&self,
cache_key: K,
loader: F,
) -> Result<(Arc<K::ValueType>, bool)>
pub async fn get_or_insert_with_key_hit<K, F, Fut>( &self, cache_key: K, loader: F, ) -> Result<(Arc<K::ValueType>, bool)>
Same as get_or_insert_with_key, but
also returns a boolean indicating whether the loader was skipped for
this call. See LanceCache::get_or_insert_with_key_hit for the
coalesced-load caveat.