pub trait GraphMutationStore: GraphStore {
// Required methods
fn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: &'life2 Label,
to: &'life3 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided method
fn apply_mutations<'life0, 'life1, 'async_trait>(
&'life0 self,
mutations: &'life1 [GraphMutation],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Incremental mutation support for stores that can delete elements.
Deletes are idempotent: removing an element that does not exist is not an error.
Required Methods§
Sourcefn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a node and all edges incident to it.
Sourcefn delete_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: &'life2 Label,
to: &'life3 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn delete_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
from: &'life1 NodeId,
label: &'life2 Label,
to: &'life3 NodeId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Deletes the edge(s) matching (from, label, to).
Provided Methods§
Sourcefn apply_mutations<'life0, 'life1, 'async_trait>(
&'life0 self,
mutations: &'life1 [GraphMutation],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_mutations<'life0, 'life1, 'async_trait>(
&'life0 self,
mutations: &'life1 [GraphMutation],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Applies mutations in order, stopping at the first error.
The default implementation calls the single-mutation methods one at a time and is not atomic: if a later mutation fails, earlier successful mutations are not rolled back. Backends with transaction support should override this method and apply the whole slice in one transaction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".