pub struct SearchCache { /* private fields */ }Expand description
Search result cache with merkle-based invalidation
Implementations§
Source§impl SearchCache
impl SearchCache
Sourcepub fn get(
&self,
prefix: &str,
query: &Query,
current_merkle_root: &[u8],
) -> Option<Vec<String>>
pub fn get( &self, prefix: &str, query: &Query, current_merkle_root: &[u8], ) -> Option<Vec<String>>
Try to get cached results for a query
Returns Some(keys) if cache hit and merkle root matches,
None if miss or stale.
Sourcepub fn insert(
&self,
prefix: &str,
query: &Query,
merkle_root: Vec<u8>,
keys: Vec<String>,
)
pub fn insert( &self, prefix: &str, query: &Query, merkle_root: Vec<u8>, keys: Vec<String>, )
Cache search results
Sourcepub fn stats(&self) -> SearchCacheStats
pub fn stats(&self) -> SearchCacheStats
Get cache statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SearchCache
impl !RefUnwindSafe for SearchCache
impl Send for SearchCache
impl Sync for SearchCache
impl Unpin for SearchCache
impl UnwindSafe for SearchCache
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