pub struct InMemoryGraph { /* private fields */ }Expand description
In-process knowledge graph. Cheap to clone (wraps Arc<RwLock<…>>).
Implementations§
Source§impl InMemoryGraph
impl InMemoryGraph
Trait Implementations§
Source§impl Clone for InMemoryGraph
impl Clone for InMemoryGraph
Source§fn clone(&self) -> InMemoryGraph
fn clone(&self) -> InMemoryGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InMemoryGraph
impl Default for InMemoryGraph
Source§impl GraphStore for InMemoryGraph
impl GraphStore for InMemoryGraph
Source§fn upsert_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert / replace a node by id.
Source§fn add_edge<'life0, 'async_trait>(
&'life0 self,
edge: Edge,
) -> Pin<Box<dyn Future<Output = Result<EdgeId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_edge<'life0, 'async_trait>(
&'life0 self,
edge: Edge,
) -> Pin<Box<dyn Future<Output = Result<EdgeId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert an edge.
Source§fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a node by id.
Source§fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EdgeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_edge<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 EdgeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up an edge by id.
Source§fn nodes_by_label<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nodes_by_label<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Node>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
All nodes carrying any of
labels.Source§fn edges_from<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn edges_from<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
All edges leaving
from (optionally filtered by label).Source§fn edges_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn edges_to<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
to: &'life1 NodeId,
label: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Edge>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
All edges entering
to (optionally filtered by label).Auto Trait Implementations§
impl Freeze for InMemoryGraph
impl RefUnwindSafe for InMemoryGraph
impl Send for InMemoryGraph
impl Sync for InMemoryGraph
impl Unpin for InMemoryGraph
impl UnsafeUnpin for InMemoryGraph
impl UnwindSafe for InMemoryGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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