Skip to main content

GraphMutWrapper

Struct GraphMutWrapper 

Source
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>

Source§

fn get_vertex(&self, id: VertexId) -> Option<Vertex>

Retrieves a vertex by its ID. Read more
Source§

fn vertex_count(&self) -> u64

Returns the total number of vertices in the graph. Read more
Source§

fn get_edge(&self, id: EdgeId) -> Option<Edge>

Retrieves an edge by its ID. Read more
Source§

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> + '_>

Returns an iterator over all outgoing edges from a vertex. Read more
Source§

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> + '_>

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> + '_>

Returns an iterator over all edges with a given label. Read more
Source§

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> + '_>

Returns an iterator over all edges in the graph. Read more
Source§

fn interner(&self) -> &StringInterner

Returns a reference to the string interner for label resolution. Read more
Source§

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> + '_>

Lookup vertices by property value, using indexes if available. Read more
Source§

fn edges_by_property( &self, label: Option<&str>, property: &str, value: &Value, ) -> Box<dyn Iterator<Item = Edge> + '_>

Lookup edges by property value, using indexes if available. Read more
Source§

fn vertices_by_property_range( &self, label: Option<&str>, property: &str, start: Bound<&Value>, end: Bound<&Value>, ) -> Box<dyn Iterator<Item = Vertex> + '_>

Lookup vertices by property range, using indexes if available. Read more
Source§

impl<'a> GraphStorageMut for GraphMutWrapper<'a>

Source§

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>

Adds a new edge connecting two vertices. Read more
Source§

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>

Sets or updates a property on an edge. Read more
Source§

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>

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V