pub struct GraphMutWrapper<'a> { /* private fields */ }Expand description
Wrapper that provides [GraphStorageMut] implementation for Graph.
This wrapper allows using the COW-based Graph with APIs that require
mutable storage access, such as the GQL mutation engine.
§Example
use interstellar::storage::{Graph, GraphStorage, GraphStorageMut};
let graph = Graph::new();
let mut wrapper = graph.as_storage_mut();
// Use wrapper with APIs requiring GraphStorageMut
let id = wrapper.add_vertex("person", std::collections::HashMap::new());
assert!(wrapper.get_vertex(id).is_some());Trait Implementations§
Source§impl<'a> GraphStorage for GraphMutWrapper<'a>
impl<'a> GraphStorage for GraphMutWrapper<'a>
Source§fn vertex_count(&self) -> u64
fn vertex_count(&self) -> u64
Returns the total number of vertices in the graph. Read more
Source§fn edge_count(&self) -> u64
fn edge_count(&self) -> u64
Returns the total number of edges in the graph. Read more
Source§fn out_edges(&self, vertex: VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
fn out_edges(&self, vertex: VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
Returns an iterator over all outgoing edges from a vertex. Read more
Source§fn in_edges(&self, vertex: VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
fn in_edges(&self, vertex: VertexId) -> Box<dyn Iterator<Item = Edge> + '_>
Returns an iterator over all incoming edges to a vertex. Read more
Source§fn vertices_with_label(
&self,
label: &str,
) -> Box<dyn Iterator<Item = Vertex> + '_>
fn vertices_with_label( &self, label: &str, ) -> Box<dyn Iterator<Item = Vertex> + '_>
Returns an iterator over all vertices with a given label. Read more
Source§fn edges_with_label(&self, label: &str) -> Box<dyn Iterator<Item = Edge> + '_>
fn edges_with_label(&self, label: &str) -> Box<dyn Iterator<Item = Edge> + '_>
Returns an iterator over all edges with a given label. Read more
Source§fn all_vertices(&self) -> Box<dyn Iterator<Item = Vertex> + '_>
fn all_vertices(&self) -> Box<dyn Iterator<Item = Vertex> + '_>
Returns an iterator over all vertices in the graph. Read more
Source§fn all_edges(&self) -> Box<dyn Iterator<Item = Edge> + '_>
fn all_edges(&self) -> Box<dyn Iterator<Item = Edge> + '_>
Returns an iterator over all edges in the graph. Read more
Source§fn interner(&self) -> &StringInterner
fn interner(&self) -> &StringInterner
Returns a reference to the string interner for label resolution. Read more
Source§fn supports_indexes(&self) -> bool
fn supports_indexes(&self) -> bool
Returns whether this storage supports property indexes. Read more
Source§fn vertices_by_property(
&self,
label: Option<&str>,
property: &str,
value: &Value,
) -> Box<dyn Iterator<Item = Vertex> + '_>
fn vertices_by_property( &self, label: Option<&str>, property: &str, value: &Value, ) -> Box<dyn Iterator<Item = Vertex> + '_>
Lookup vertices by property value, using indexes if available. Read more
Source§impl<'a> GraphStorageMut for GraphMutWrapper<'a>
impl<'a> GraphStorageMut for GraphMutWrapper<'a>
Source§fn add_vertex(
&mut self,
label: &str,
properties: HashMap<String, Value>,
) -> VertexId
fn add_vertex( &mut self, label: &str, properties: HashMap<String, Value>, ) -> VertexId
Adds a new vertex with the given label and properties. Read more
Source§fn add_edge(
&mut self,
src: VertexId,
dst: VertexId,
label: &str,
properties: HashMap<String, Value>,
) -> Result<EdgeId, StorageError>
fn add_edge( &mut self, src: VertexId, dst: VertexId, label: &str, properties: HashMap<String, Value>, ) -> Result<EdgeId, StorageError>
Adds a new edge connecting two vertices. Read more
Source§fn set_vertex_property(
&mut self,
id: VertexId,
key: &str,
value: Value,
) -> Result<(), StorageError>
fn set_vertex_property( &mut self, id: VertexId, key: &str, value: Value, ) -> Result<(), StorageError>
Sets or updates a property on a vertex. Read more
Source§fn set_edge_property(
&mut self,
id: EdgeId,
key: &str,
value: Value,
) -> Result<(), StorageError>
fn set_edge_property( &mut self, id: EdgeId, key: &str, value: Value, ) -> Result<(), StorageError>
Sets or updates a property on an edge. Read more
Source§fn remove_vertex(&mut self, id: VertexId) -> Result<(), StorageError>
fn remove_vertex(&mut self, id: VertexId) -> Result<(), StorageError>
Removes a vertex and all its incident edges. Read more
Source§fn remove_edge(&mut self, id: EdgeId) -> Result<(), StorageError>
fn remove_edge(&mut self, id: EdgeId) -> Result<(), StorageError>
Removes an edge from the graph. Read more
Auto Trait Implementations§
impl<'a> Freeze for GraphMutWrapper<'a>
impl<'a> !RefUnwindSafe for GraphMutWrapper<'a>
impl<'a> Send for GraphMutWrapper<'a>
impl<'a> Sync for GraphMutWrapper<'a>
impl<'a> Unpin for GraphMutWrapper<'a>
impl<'a> UnsafeUnpin for GraphMutWrapper<'a>
impl<'a> !UnwindSafe for GraphMutWrapper<'a>
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