pub struct PathDistanceCache { /* private fields */ }Expand description
LRU cache for path distances
Implementations§
Source§impl PathDistanceCache
impl PathDistanceCache
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create with custom config
Sourcepub fn get(&self, source: VertexId, target: VertexId) -> Option<f64>
pub fn get(&self, source: VertexId, target: VertexId) -> Option<f64>
Get cached distance if available
Sourcepub fn insert(&self, source: VertexId, target: VertexId, distance: f64)
pub fn insert(&self, source: VertexId, target: VertexId, distance: f64)
Insert distance into cache
Sourcepub fn insert_prefetch(&self, source: VertexId, target: VertexId, distance: f64)
pub fn insert_prefetch(&self, source: VertexId, target: VertexId, distance: f64)
Insert with prefetch flag
Sourcepub fn insert_batch(&self, entries: &[(VertexId, VertexId, f64)])
pub fn insert_batch(&self, entries: &[(VertexId, VertexId, f64)])
Batch insert multiple distances
Sourcepub fn invalidate_vertex(&self, vertex: VertexId)
pub fn invalidate_vertex(&self, vertex: VertexId)
Invalidate entries involving a vertex
Sourcepub fn get_prefetch_hints(&self) -> Vec<PrefetchHint>
pub fn get_prefetch_hints(&self) -> Vec<PrefetchHint>
Get prefetch hints based on access patterns
Sourcepub fn get_predicted_queries(&self) -> Vec<(VertexId, VertexId)>
pub fn get_predicted_queries(&self) -> Vec<(VertexId, VertexId)>
Get predicted queries for prefetching
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PathDistanceCache
impl RefUnwindSafe for PathDistanceCache
impl Send for PathDistanceCache
impl Sync for PathDistanceCache
impl Unpin for PathDistanceCache
impl UnwindSafe for PathDistanceCache
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