pub struct PathCache { /* private fields */ }Expand description
Path cache for retrieval optimization.
Caches search paths and node scores to avoid redundant computation for similar queries.
Implementations§
Source§impl PathCache
impl PathCache
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create a path cache with custom config.
Sourcepub fn from_app_config(config: &AppConfig) -> Self
pub fn from_app_config(config: &AppConfig) -> Self
Create from application config.
Sourcepub fn store_paths(&self, query: &str, paths: Vec<SearchPath>)
pub fn store_paths(&self, query: &str, paths: Vec<SearchPath>)
Store paths for a query.
Sourcepub fn get_score(&self, query: &str, node_id: NodeId) -> Option<f32>
pub fn get_score(&self, query: &str, node_id: NodeId) -> Option<f32>
Get cached score for a node.
Sourcepub fn store_score(&self, query: &str, node_id: NodeId, score: f32)
pub fn store_score(&self, query: &str, node_id: NodeId, score: f32)
Store a node score.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathCache
impl RefUnwindSafe for PathCache
impl Send for PathCache
impl Sync for PathCache
impl Unpin for PathCache
impl UnsafeUnpin for PathCache
impl UnwindSafe for PathCache
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