[−][src]Struct graphs::simple_graph::SimpleGraph
A simple directed graph implementation.
-
Nodes are represented with
Vec<N>
-
Edges are represented with
Vec<Vec<Option<E>>>
-
All IDs are opaque data structures
Please see the trait implementations for more details
Implementations
impl<N, E> SimpleGraph<N, E>
[src]
Trait Implementations
impl<N: Clone, E: Clone> Clone for SimpleGraph<N, E>
[src]
pub fn clone(&self) -> SimpleGraph<N, E>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<N: Debug, E: Debug> Debug for SimpleGraph<N, E>
[src]
impl<N, E> GraphBase for SimpleGraph<N, E>
[src]
impl<N, E> GraphEdgeAddable<E> for SimpleGraph<N, E> where
E: Clone,
[src]
E: Clone,
pub fn add_edge(
&mut self,
a: Self::NodeID,
b: Self::NodeID,
data: E
) -> Self::EdgeID
[src]
&mut self,
a: Self::NodeID,
b: Self::NodeID,
data: E
) -> Self::EdgeID
Data added from node A
to B
will overwrite the data that was previously between those edges
impl<N, E> GraphEdgeEndpoints for SimpleGraph<N, E>
[src]
impl<N, E> GraphEdgeFrom for SimpleGraph<N, E>
[src]
pub fn edge_from(&self, EdgeID((id_a, _)): Self::EdgeID) -> Self::NodeID
[src]
Find the source of an edge
impl<N, E> GraphEdgeIndexable<E> for SimpleGraph<N, E>
[src]
pub fn edge(&self, EdgeID((id_a, id_b)): Self::EdgeID) -> &E
[src]
Get the data associated with an edge
Panics if the edge is not in the graph
impl<N, E> GraphEdgeMutIndexable<E> for SimpleGraph<N, E>
[src]
pub fn edge_mut(&mut self, EdgeID((id_a, id_b)): Self::EdgeID) -> &mut E
[src]
Get the data associated with an edge
Panics if the edge is not in the graph
impl<N, E> GraphEdgeRemovable<E> for SimpleGraph<N, E>
[src]
pub fn remove_edge(&mut self, EdgeID((id_a, id_b)): Self::EdgeID) -> E
[src]
Panics if the node is not in the graph
impl<N, E> GraphEdgeTo for SimpleGraph<N, E>
[src]
pub fn edge_to(&self, EdgeID((_, id_b)): Self::EdgeID) -> Self::NodeID
[src]
Find the destination of an edge
impl<N, E> GraphEdgesFrom for SimpleGraph<N, E>
[src]
type EdgesFromOutput = Vec<EdgeID>
pub fn edges_from(&self, NodeID(id): Self::NodeID) -> Self::EdgesFromOutput
[src]
Find all edges from a node
Return result in a Vec
impl<N, E> GraphNodeAddable<N> for SimpleGraph<N, E>
[src]
pub fn add_node(&mut self, data: N) -> Self::NodeID
[src]
Identical data added twice will return different node IDs
impl<N, E> GraphNodeIndexable<N> for SimpleGraph<N, E>
[src]
pub fn node(&self, NodeID(id): Self::NodeID) -> &N
[src]
Get the data associated with a node
Panics if the node is not in the graph
impl<N, E> GraphNodeMutIndexable<N> for SimpleGraph<N, E>
[src]
pub fn node_mut(&mut self, NodeID(id): Self::NodeID) -> &mut N
[src]
Get the data associated with a node
Panics if the node is not in the graph
impl<N, E> GraphNodeRemovable<N> for SimpleGraph<N, E>
[src]
pub fn remove_node(&mut self, NodeID(id): Self::NodeID) -> N
[src]
Panics if the node is not in the graph
Panics if any edges lead into or out of that edge
Auto Trait Implementations
impl<N, E> RefUnwindSafe for SimpleGraph<N, E> where
E: RefUnwindSafe,
N: RefUnwindSafe,
[src]
E: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, E> Send for SimpleGraph<N, E> where
E: Send,
N: Send,
[src]
E: Send,
N: Send,
impl<N, E> Sync for SimpleGraph<N, E> where
E: Sync,
N: Sync,
[src]
E: Sync,
N: Sync,
impl<N, E> Unpin for SimpleGraph<N, E> where
E: Unpin,
N: Unpin,
[src]
E: Unpin,
N: Unpin,
impl<N, E> UnwindSafe for SimpleGraph<N, E> where
E: UnwindSafe,
N: UnwindSafe,
[src]
E: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,