pub struct SimpleGraph<Vertex, Edge>{ /* private fields */ }Expand description
A graph that is backed by a simple in-memory data structure.
Implementations§
Trait Implementations§
Source§impl<Vertex, Edge> Debug for SimpleGraph<Vertex, Edge>
 
impl<Vertex, Edge> Debug for SimpleGraph<Vertex, Edge>
Source§impl<Vertex, Edge> Default for SimpleGraph<Vertex, Edge>
 
impl<Vertex, Edge> Default for SimpleGraph<Vertex, Edge>
Source§impl<Vertex, Edge> Graph for SimpleGraph<Vertex, Edge>
 
impl<Vertex, Edge> Graph for SimpleGraph<Vertex, Edge>
Source§type VertexReference<'graph> = VertexReference<'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type VertexReference<'graph> = VertexReference<'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
A reference to a vertex.
Source§type VertexReferenceMut<'graph> = VertexReferenceMut<'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type VertexReferenceMut<'graph> = VertexReferenceMut<'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
A mut reference to a vertex.
Source§type EdgeReference<'graph> = EdgeReference<'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type EdgeReference<'graph> = EdgeReference<'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
An edge reference is used during walking over edges. It includes the id, tail, head and weight of the edge.
Source§type EdgeReferenceMut<'graph> = EdgeReferenceMut<'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type EdgeReferenceMut<'graph> = EdgeReferenceMut<'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
A mut edge reference to modify the edge.
Source§type EdgeIter<'search, 'graph> = EdgeIter<'search, 'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type EdgeIter<'search, 'graph> = EdgeIter<'search, 'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
An iterator over the edge references.
Source§type VertexIter<'search, 'graph> = VertexIter<'search, 'graph, SimpleGraph<Vertex, Edge>>
where
    Self: 'graph
 
type VertexIter<'search, 'graph> = VertexIter<'search, 'graph, SimpleGraph<Vertex, Edge>> where Self: 'graph
An iterator over the vertex references.
Source§fn add_vertex(&mut self, vertex: Self::Vertex) -> Self::VertexId
 
fn add_vertex(&mut self, vertex: Self::Vertex) -> Self::VertexId
Adds a vertex to the graph and returns its identifier.
Source§fn add_edge(
    &mut self,
    from: Self::VertexId,
    to: Self::VertexId,
    edge: Self::Edge,
) -> Self::EdgeId
 
fn add_edge( &mut self, from: Self::VertexId, to: Self::VertexId, edge: Self::Edge, ) -> Self::EdgeId
Adds an edge to the graph and returns its identifier.
Source§fn remove_vertex(&mut self, id: Self::VertexId) -> Option<Self::Vertex>
 
fn remove_vertex(&mut self, id: Self::VertexId) -> Option<Self::Vertex>
Removes a vertex from the graph and returns the vertex.
Source§fn remove_edge(&mut self, edge: Self::EdgeId) -> Option<Self::Edge>
 
fn remove_edge(&mut self, edge: Self::EdgeId) -> Option<Self::Edge>
Removes an edge from the graph and returns the edge.
Source§fn vertex(&self, id: Self::VertexId) -> Option<Self::VertexReference<'_>>
 
fn vertex(&self, id: Self::VertexId) -> Option<Self::VertexReference<'_>>
Gets the vertex with the specified identifier.
Source§fn vertex_mut(
    &mut self,
    id: Self::VertexId,
) -> Option<Self::VertexReferenceMut<'_>>
 
fn vertex_mut( &mut self, id: Self::VertexId, ) -> Option<Self::VertexReferenceMut<'_>>
Returns the vertex with the specified identifier.
Source§fn vertices<'search>(
    &self,
    search: &VertexSearch<'search, Self>,
) -> Self::VertexIter<'search, '_>
 
fn vertices<'search>( &self, search: &VertexSearch<'search, Self>, ) -> Self::VertexIter<'search, '_>
Iterate over vertex identifiers.
Graphs should try to narrow down the returned vertices using the search criteria, but overfetch will be filtered.
Source§fn edge(&self, id: Self::EdgeId) -> Option<Self::EdgeReference<'_>>
 
fn edge(&self, id: Self::EdgeId) -> Option<Self::EdgeReference<'_>>
Gets the edge with the specified identifier.
Source§fn edge_mut(&mut self, edge: Self::EdgeId) -> Option<Self::EdgeReferenceMut<'_>>
 
fn edge_mut(&mut self, edge: Self::EdgeId) -> Option<Self::EdgeReferenceMut<'_>>
Gets the edge with the specified identifier.
Source§fn edges<'search>(
    &self,
    vertex: Self::VertexId,
    search: &EdgeSearch<'search, Self>,
) -> Self::EdgeIter<'search, '_>
 
fn edges<'search>( &self, vertex: Self::VertexId, search: &EdgeSearch<'search, Self>, ) -> Self::EdgeIter<'search, '_>
Returns an iterator over the edges of a vertex.
Graphs should try to narrow down the returned edges using the search criteria, but overfetch will be filtered.
Source§fn clear(&mut self)
 
fn clear(&mut self)
Clears the graph. Default implementation returns an error.
Implement the 
SupportsClear trait to provide this functionality.Source§impl<Vertex, Edge> SupportsClear for SimpleGraph<Vertex, Edge>
 
impl<Vertex, Edge> SupportsClear for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsEdgeAdjacentLabelIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsEdgeHashIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsEdgeLabelIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsEdgeRangeIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsVertexFullTextIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsVertexHashIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsVertexLabelIndex for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> SupportsVertexRangeIndex for SimpleGraph<Vertex, Edge>
Auto Trait Implementations§
impl<Vertex, Edge> Freeze for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> RefUnwindSafe for SimpleGraph<Vertex, Edge>where
    Edge: RefUnwindSafe,
    Vertex: RefUnwindSafe,
impl<Vertex, Edge> Send for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> Sync for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> Unpin for SimpleGraph<Vertex, Edge>
impl<Vertex, Edge> UnwindSafe for SimpleGraph<Vertex, Edge>where
    Edge: UnwindSafe,
    Vertex: UnwindSafe,
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> 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