Trait graph_types::ValueProvider
source · pub trait ValueProvider<'a, V>: Send + Sync {
type ValueRef: Deref<Target = V>;
type ValueMut: DerefMut<Target = V>;
// Required methods
fn get_value(&'a self, query: Query) -> Result<Self::ValueRef, GraphError>;
fn mut_value(
&'a mut self,
query: Query
) -> Result<Self::ValueMut, GraphError>;
// Provided method
fn set_value(&'a mut self, query: Query, value: V) -> Result<V, GraphError> { ... }
}
Expand description
Extend the ability to get a value from a graph
Examples
use graph_theory::{entry_engines::ListStorage, EntryEngine, GraphEngine};