Struct rs_graph::vecgraph::VecGraph

source ·
pub struct VecGraph<ID = u32> { /* private fields */ }
Expand description

A vector based graph data structure.

Implementations§

source§

impl<ID> VecGraph<ID>where ID: PrimInt + Unsigned,

source

pub fn new() -> VecGraph<ID>

Trait Implementations§

source§

impl<ID> Buildable for VecGraph<ID>where ID: PrimInt + Unsigned,

§

type Builder = VecGraphBuilder<ID>

source§

fn new_builder() -> Self::Builder

Create a new builder for this graph type.
source§

fn new_with<F>(f: F) -> Selfwhere F: FnOnce(&mut Self::Builder),

Create a new graph by passing the builder to the callback f. Read more
source§

impl<ID> Default for VecGraph<ID>where ID: PrimInt + Unsigned,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, ID> Deserialize<'de> for VecGraph<ID>where ID: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<ID> Directed for VecGraph<ID>where ID: PrimInt + Unsigned + 'static,

§

type OutIt<'a> = NeighIt<'a, ID>

Type of a graph iterator over edges leaving a node.
§

type InIt<'a> = NeighIt<'a, ID>

Type of a graph iterator over edges entering a node.
§

type IncidentIt<'a> = NeighIt<'a, ID>

Type of an iterator over all incident edges.
§

type DirectedEdge<'a> = <VecGraph<ID> as GraphType>::Edge<'a>

Type of a directed edge.
source§

fn out_iter(&self, u: Self::Node<'_>) -> Self::OutIt<'_>

Return a graph iterator over the edges leaving a node.
source§

fn in_iter(&self, u: Self::Node<'_>) -> Self::InIt<'_>

Return a graph iterator over the edges leaving a node.
source§

fn incident_iter(&self, u: Self::Node<'_>) -> Self::IncidentIt<'_>

Return an iterator over all directed edges incident with a node.
source§

fn outedges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::OutIt<'_>> where Self: Sized,

Return an iterator over the edges leaving a node.
source§

fn outgoing(&self) -> OutEdges<'_, Self>where Self: Sized,

Return access to the outgoing arcs via an Adjacencies trait. Read more
source§

fn inedges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::InIt<'_>> where Self: Sized,

Return an iterator over the edges leaving a node.
source§

fn incoming(&self) -> InEdges<'_, Self>where Self: Sized,

Return access to the incoming arcs via an Adjacencies trait. Read more
source§

fn incident_edges( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Directed>::IncidentIt<'_>> where Self: Sized,

Return an iterator over all directed edges incident with a node.
source§

impl<ID> FiniteDigraph for VecGraph<ID>where ID: PrimInt + Unsigned,

source§

fn src(&self, e: Self::Edge<'_>) -> Self::Node<'_>

Return the source node of an edge.
source§

fn snk(&self, e: Self::Edge<'_>) -> Self::Node<'_>

Return the sink node of an edge.
source§

impl<ID> FiniteGraph for VecGraph<ID>where ID: PrimInt + Unsigned,

§

type NodeIt<'a> = NodeIt<ID> where ID: 'a

Type of an iterator over all nodes.
§

type EdgeIt<'a> = EdgeIt<ID> where ID: 'a

Type of an iterator over all edges.
source§

fn num_nodes(&self) -> usize

Return the number of nodes in the graph.
source§

fn num_edges(&self) -> usize

Return the number of edges in the graph.
source§

fn nodes_iter(&self) -> Self::NodeIt<'_>

Return a graph iterator over all nodes.
source§

fn edges_iter(&self) -> Self::EdgeIt<'_>

Return a graph iterator over all edges. Read more
source§

fn enodes(&self, e: Self::Edge<'_>) -> (Self::Node<'_>, Self::Node<'_>)

Return the nodes connected by an edge. Read more
source§

fn nodes(&self) -> NodeIterator<'_, Self>where Self: Sized,

Return an iterator over all nodes.
source§

fn edges(&self) -> EdgeIterator<'_, Self>where Self: Sized,

Return an iterator over all edges. Read more
source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for EdgeIt<ID>where ID: 'a + PrimInt + Unsigned,

§

type Item = Edge<ID>

source§

fn next(&mut self, _g: &VecGraph<ID>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &VecGraph<ID>) -> (usize, Option<usize>)

source§

fn count(self, _g: &VecGraph<ID>) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for NeighIt<'a, ID>where ID: PrimInt + Unsigned,

§

type Item = (Edge<ID>, Node<ID>)

source§

fn next(&mut self, g: &VecGraph<ID>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &G) -> (usize, Option<usize>)

source§

fn count(self, g: &G) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<'a, ID> GraphIterator<VecGraph<ID>> for NodeIt<ID>where ID: 'a + PrimInt + Unsigned,

§

type Item = Node<ID>

source§

fn next(&mut self, _g: &VecGraph<ID>) -> Option<Self::Item>

source§

fn size_hint(&self, _g: &VecGraph<ID>) -> (usize, Option<usize>)

source§

fn count(self, _g: &VecGraph<ID>) -> usize

source§

fn iter(self, g: &G) -> GraphIter<'_, G, Self> where G: Sized,

source§

impl<ID> GraphType for VecGraph<ID>where ID: PrimInt + Unsigned,

§

type Node<'a> = Node<ID>

Type of a node.
§

type Edge<'a> = Edge<ID>

Type of an edge.
source§

impl<ID> IndexGraph for VecGraph<ID>where ID: PrimInt + Unsigned + 'static,

source§

fn node_id(&self, u: Self::Node<'_>) -> usize

Return a unique id associated with a node.
source§

fn id2node(&self, id: usize) -> Self::Node<'_>

Return the node associated with the given id. Read more
source§

fn edge_id(&self, e: Self::Edge<'_>) -> usize

Return a unique id associated with an edge. Read more
source§

fn id2edge(&self, id: usize) -> Self::Edge<'_>

Return the edge associated with the given id. Read more
source§

impl<ID> Serialize for VecGraph<ID>where ID: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<ID> Undirected for VecGraph<ID>where ID: PrimInt + Unsigned + 'static,

§

type NeighIt<'a> = NeighIt<'a, ID>

Type of a graph iterator over all incident edges.
source§

fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>

Return a graph iterator over the edges adjacent to some node.
source§

fn neighs( &self, u: Self::Node<'_> ) -> GraphIter<'_, Self, <Self as Undirected>::NeighIt<'_>> where Self: Sized,

Return an iterator over the edges adjacent to some node.
source§

fn neighbors(&self) -> Neighbors<'_, Self>where Self: Sized,

Return access to the neighbors via an Adjacencies trait. Read more

Auto Trait Implementations§

§

impl<ID> RefUnwindSafe for VecGraph<ID>where ID: RefUnwindSafe,

§

impl<ID> Send for VecGraph<ID>where ID: Send,

§

impl<ID> Sync for VecGraph<ID>where ID: Sync,

§

impl<ID> Unpin for VecGraph<ID>where ID: Unpin,

§

impl<ID> UnwindSafe for VecGraph<ID>where ID: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<G> Digraph for Gwhere G: FiniteDigraph + Directed,

source§

impl<G> Graph for Gwhere G: FiniteGraph + Undirected,

source§

impl<T> IndexDigraph for Twhere T: IndexGraph + Digraph,