pub struct Network<'a, G>(/* private fields */);
Expand description
The network graph adaptor.
It is meant to be used by borrowing the underlying graph.
(also see the module description adapters::network
).
let g = classes::cycle::<LinkedListGraph>(5);
let n = Network::new(&g);
The network inherits all trait implementations from the underlying graph. In
particular, if the underlying graph implements IndexGraph
then nodes and
edges of the network are numbered, too:
- The
node_id
is the same as in the underlying graph, - the edge with id
i
is mapped to the edges2*i
(forward edge) and2*i+1
(backward edge).
Implementations§
Trait Implementations§
Source§impl<'g, G> Directed for Network<'g, G>where
G: Directed,
impl<'g, G> Directed for Network<'g, G>where
G: Directed,
Source§type OutIt<'a> = NetworkOutIt<<G as Directed>::IncidentIt<'a>>
where
G: 'a,
'g: 'a
type OutIt<'a> = NetworkOutIt<<G as Directed>::IncidentIt<'a>> where G: 'a, 'g: 'a
Type of a graph iterator over edges leaving a node.
Source§type InIt<'a> = NetworkInIt<<G as Directed>::IncidentIt<'a>>
where
G: 'a,
'g: 'a
type InIt<'a> = NetworkInIt<<G as Directed>::IncidentIt<'a>> where G: 'a, 'g: 'a
Type of a graph iterator over edges entering a node.
Source§type IncidentIt<'a> = NetworkIncidentIt<<G as Directed>::IncidentIt<'a>, (<G as Directed>::DirectedEdge<'a>, <G as GraphType>::Node<'a>)>
where
G: 'a,
'g: 'a
type IncidentIt<'a> = NetworkIncidentIt<<G as Directed>::IncidentIt<'a>, (<G as Directed>::DirectedEdge<'a>, <G as GraphType>::Node<'a>)> where G: 'a, 'g: 'a
Type of an iterator over all incident edges.
Source§type DirectedEdge<'a> = NetworkDirectedEdge<<Network<'g, G> as GraphType>::Edge<'a>>
where
Self: 'a
type DirectedEdge<'a> = NetworkDirectedEdge<<Network<'g, G> as GraphType>::Edge<'a>> where Self: 'a
Type of a directed edge.
Source§fn out_iter(&self, u: Self::Node<'_>) -> Self::OutIt<'_>
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<'_>
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<'_>
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,
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,
fn outgoing(&self) -> OutEdges<'_, Self>where
Self: Sized,
Return access to the outgoing arcs via an
Adjacencies
trait. Read moreSource§fn inedges(
&self,
u: Self::Node<'_>,
) -> GraphIter<'_, Self, <Self as Directed>::InIt<'_>> ⓘwhere
Self: Sized,
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,
fn incoming(&self) -> InEdges<'_, Self>where
Self: Sized,
Return access to the incoming arcs via an
Adjacencies
trait. Read moreSource§fn incident_edges(
&self,
u: Self::Node<'_>,
) -> GraphIter<'_, Self, <Self as Directed>::IncidentIt<'_>> ⓘwhere
Self: Sized,
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<'a, G> DirectedRef<'a> for Network<'a, G>where
G: 'a + Directed,
impl<'a, G> DirectedRef<'a> for Network<'a, G>where
G: 'a + Directed,
Source§type OutIt = NetworkOutIt<<G as Directed>::IncidentIt<'a>>
type OutIt = NetworkOutIt<<G as Directed>::IncidentIt<'a>>
Type of a graph iterator over edges leaving a node.
Source§type InIt = NetworkInIt<<G as Directed>::IncidentIt<'a>>
type InIt = NetworkInIt<<G as Directed>::IncidentIt<'a>>
Type of a graph iterator over edges entering a node.
Source§type IncidentIt = NetworkIncidentIt<<G as Directed>::IncidentIt<'a>, (<G as Directed>::DirectedEdge<'a>, <G as GraphType>::Node<'a>)>
type IncidentIt = NetworkIncidentIt<<G as Directed>::IncidentIt<'a>, (<G as Directed>::DirectedEdge<'a>, <G as GraphType>::Node<'a>)>
Type of an iterator over all incident edges.
Source§type DirectedEdge = NetworkDirectedEdge<<Network<'a, G> as GraphTypeRef<'a>>::Edge>
type DirectedEdge = NetworkDirectedEdge<<Network<'a, G> as GraphTypeRef<'a>>::Edge>
Type of a directed edge.
Source§fn out_iter(&self, u: Self::Node) -> Self::OutIt
fn out_iter(&self, u: Self::Node) -> Self::OutIt
Return the source node of an edge.
Return the sink node of an edge.
Return a graph iterator over the edges leaving a node.
Source§fn in_iter(&self, u: Self::Node) -> Self::InIt
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
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::OutIt> ⓘwhere
Self: Sized,
fn outedges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::OutIt> ⓘwhere
Self: Sized,
Return an iterator over the edges leaving a node.
Source§fn inedges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::InIt> ⓘwhere
Self: Sized,
fn inedges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::InIt> ⓘwhere
Self: Sized,
Return an iterator over the edges leaving a node.
Source§fn incident_edges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::IncidentIt> ⓘwhere
Self: Sized,
fn incident_edges(&self, u: Self::Node) -> GraphIter<'_, Self, Self::IncidentIt> ⓘwhere
Self: Sized,
Return an iterator over all directed edges incident with a node.
Source§impl<'g, G> FiniteDigraph for Network<'g, G>where
G: FiniteDigraph,
impl<'g, G> FiniteDigraph for Network<'g, G>where
G: FiniteDigraph,
Source§impl<'a, G> FiniteDigraphRef<'a> for Network<'a, G>where
G: FiniteDigraph,
impl<'a, G> FiniteDigraphRef<'a> for Network<'a, G>where
G: FiniteDigraph,
Source§impl<'g, G> FiniteGraph for Network<'g, G>where
G: FiniteGraph,
impl<'g, G> FiniteGraph for Network<'g, G>where
G: FiniteGraph,
Source§type NodeIt<'a> = NetworkNodeIt<<G as FiniteGraph>::NodeIt<'a>>
where
G: 'a,
'g: 'a
type NodeIt<'a> = NetworkNodeIt<<G as FiniteGraph>::NodeIt<'a>> where G: 'a, 'g: 'a
Type of an iterator over all nodes.
Source§type EdgeIt<'a> = NetworkEdgeIt<G, <G as FiniteGraph>::EdgeIt<'a>>
where
G: 'a,
'g: 'a
type EdgeIt<'a> = NetworkEdgeIt<G, <G as FiniteGraph>::EdgeIt<'a>> where G: 'a, 'g: 'a
Type of an iterator over all edges.
Source§fn nodes_iter(&self) -> Self::NodeIt<'_>
fn nodes_iter(&self) -> Self::NodeIt<'_>
Return a graph iterator over all nodes.
Source§fn edges_iter(&self) -> Self::EdgeIt<'_>
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<'_>)
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,
fn nodes(&self) -> NodeIterator<'_, Self>where
Self: Sized,
Return an iterator over all nodes.
Source§impl<'a, G> FiniteGraphRef<'a> for Network<'a, G>where
G: FiniteGraph,
impl<'a, G> FiniteGraphRef<'a> for Network<'a, G>where
G: FiniteGraph,
Source§type NodeIt = NetworkNodeIt<<G as FiniteGraph>::NodeIt<'a>>
type NodeIt = NetworkNodeIt<<G as FiniteGraph>::NodeIt<'a>>
Type of an iterator over all nodes.
Source§type EdgeIt = NetworkEdgeIt<G, <G as FiniteGraph>::EdgeIt<'a>>
type EdgeIt = NetworkEdgeIt<G, <G as FiniteGraph>::EdgeIt<'a>>
Type of an iterator over all edges.
Source§fn nodes_iter(&self) -> Self::NodeIt
fn nodes_iter(&self) -> Self::NodeIt
Return a graph iterator over all nodes.
Source§fn edges_iter(&self) -> Self::EdgeIt
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)
fn enodes(&self, e: Self::Edge) -> (Self::Node, Self::Node)
Return the nodes connected by an edge. Read more
Source§impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkEdgeIt<G, I>
impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkEdgeIt<G, I>
type Item = NetworkEdge<<I as GraphIterator<G>>::Item>
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkInIt<I>
impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkInIt<I>
type Item = (NetworkEdge<<D as DirectedEdge>::Edge>, N)
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkIncidentIt<I, I::Item>
impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkIncidentIt<I, I::Item>
type Item = (NetworkDirectedEdge<NetworkEdge<<D as DirectedEdge>::Edge>>, N)
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G, I, N, E> GraphIterator<Network<'a, G>> for NetworkNeighIt<G, I>
impl<'a, G, I, N, E> GraphIterator<Network<'a, G>> for NetworkNeighIt<G, I>
type Item = (NetworkEdge<E>, N)
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkNodeIt<I>where
I: GraphIterator<G>,
impl<'a, G, I> GraphIterator<Network<'a, G>> for NetworkNodeIt<I>where
I: GraphIterator<G>,
type Item = <I as GraphIterator<G>>::Item
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkOutIt<I>
impl<'a, G, I, N, D> GraphIterator<Network<'a, G>> for NetworkOutIt<I>
type Item = (NetworkEdge<<D as DirectedEdge>::Edge>, N)
fn next(&mut self, net: &Network<'a, G>) -> Option<Self::Item>
fn size_hint(&self, net: &Network<'a, G>) -> (usize, Option<usize>)
fn count(self, net: &Network<'a, G>) -> usize
fn iter(self, g: &G) -> GraphIter<'_, G, Self> ⓘwhere
G: Sized,
Source§impl<'a, G> GraphTypeRef<'a> for Network<'a, G>where
G: GraphType,
impl<'a, G> GraphTypeRef<'a> for Network<'a, G>where
G: GraphType,
Source§impl<'g, G> IndexGraph for Network<'g, G>where
G: IndexGraph,
impl<'g, G> IndexGraph for Network<'g, G>where
G: IndexGraph,
Source§impl<'a, G> IndexGraphRef<'a> for Network<'a, G>where
G: IndexGraph,
impl<'a, G> IndexGraphRef<'a> for Network<'a, G>where
G: IndexGraph,
Source§impl<'g, G> Undirected for Network<'g, G>where
G: Undirected,
impl<'g, G> Undirected for Network<'g, G>where
G: Undirected,
Source§type NeighIt<'a> = NetworkNeighIt<G, <G as Undirected>::NeighIt<'a>>
where
G: 'a,
'g: 'a
type NeighIt<'a> = NetworkNeighIt<G, <G as Undirected>::NeighIt<'a>> where G: 'a, 'g: 'a
Type of a graph iterator over all incident edges.
Source§fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>
fn neigh_iter(&self, u: Self::Node<'_>) -> Self::NeighIt<'_>
Return a graph iterator over the edges adjacent to some node.
Source§impl<'a, G> UndirectedRef<'a> for Network<'a, G>where
G: Undirected,
impl<'a, G> UndirectedRef<'a> for Network<'a, G>where
G: Undirected,
Source§type NeighIt = NetworkNeighIt<G, <G as Undirected>::NeighIt<'a>>
type NeighIt = NetworkNeighIt<G, <G as Undirected>::NeighIt<'a>>
Type of a graph iterator over all incident edges.
Source§fn neigh_iter(&self, u: Self::Node) -> Self::NeighIt
fn neigh_iter(&self, u: Self::Node) -> Self::NeighIt
Return a graph iterator over the edges adjacent to some node.
impl<'a, G: Copy> Copy for Network<'a, G>
Auto Trait Implementations§
impl<'a, G> Freeze for Network<'a, G>
impl<'a, G> RefUnwindSafe for Network<'a, G>where
G: RefUnwindSafe,
impl<'a, G> Send for Network<'a, G>where
G: Sync,
impl<'a, G> Sync for Network<'a, G>where
G: Sync,
impl<'a, G> Unpin for Network<'a, G>
impl<'a, G> UnwindSafe for Network<'a, G>where
G: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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