pub struct TraversalCache { /* private fields */ }Expand description
Simple in-memory traversal cache.
Implementations§
Source§impl TraversalCache
impl TraversalCache
pub fn new() -> Self
pub fn get_neighbors(&self, entity_id: &str) -> Option<SubGraph>
pub fn put_neighbors(&self, entity_id: String, subgraph: SubGraph)
pub fn get_path(&self, from: &str, to: &str) -> Option<Vec<Vec<PathStep>>>
pub fn put_path(&self, from: String, to: String, paths: Vec<Vec<PathStep>>)
pub fn get_entity(&self, id: &str) -> Option<Entity>
pub fn put_entity(&self, id: String, entity: Entity)
pub fn get_relations(&self, entity_id: &str) -> Option<Vec<Relation>>
pub fn put_relations(&self, entity_id: String, relations: Vec<Relation>)
Sourcepub fn invalidate_all(&self)
pub fn invalidate_all(&self)
Invalidate all cached data.
Trait Implementations§
Source§impl Debug for TraversalCache
impl Debug for TraversalCache
Source§impl Default for TraversalCache
impl Default for TraversalCache
Source§fn default() -> TraversalCache
fn default() -> TraversalCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for TraversalCache
impl RefUnwindSafe for TraversalCache
impl Send for TraversalCache
impl Sync for TraversalCache
impl Unpin for TraversalCache
impl UnsafeUnpin for TraversalCache
impl UnwindSafe for TraversalCache
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