Struct petgraph::visit::Reversed

source ·
pub struct Reversed<G>(pub G);
Expand description

An edge-reversing graph adaptor.

All edges have the opposite direction with Reversed.

Tuple Fields§

§0: G

Trait Implementations§

source§

impl<G: Clone> Clone for Reversed<G>

source§

fn clone(&self) -> Reversed<G>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<G> Data for Reversed<G>where G: Data,

source§

impl<G> DataMap for Reversed<G>where G: DataMap,

source§

fn node_weight(&self, id: Self::NodeId) -> Option<&Self::NodeWeight>

source§

fn edge_weight(&self, id: Self::EdgeId) -> Option<&Self::EdgeWeight>

source§

impl<G> DataMapMut for Reversed<G>where G: DataMapMut,

source§

fn node_weight_mut(&mut self, id: Self::NodeId) -> Option<&mut Self::NodeWeight>

source§

fn edge_weight_mut(&mut self, id: Self::EdgeId) -> Option<&mut Self::EdgeWeight>

source§

impl<G: Debug> Debug for Reversed<G>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<G> EdgeCount for Reversed<G>where G: EdgeCount,

source§

fn edge_count(&self) -> usize

Return the number of edges in the graph.
source§

impl<G> EdgeIndexable for Reversed<G>where G: EdgeIndexable,

source§

fn edge_bound(&self) -> usize

Return an upper bound of the edge indices in the graph (suitable for the size of a bitmap).
source§

fn to_index(&self, a: Self::EdgeId) -> usize

Convert a to an integer index.
source§

fn from_index(&self, i: usize) -> Self::EdgeId

Convert i to an edge index. i must be a valid value in the graph.
source§

impl<G> GetAdjacencyMatrix for Reversed<G>where G: GetAdjacencyMatrix,

§

type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix

The associated adjacency matrix type
source§

fn adjacency_matrix(&self) -> Self::AdjMatrix

Create the adjacency matrix
source§

fn is_adjacent( &self, matrix: &Self::AdjMatrix, a: Self::NodeId, b: Self::NodeId ) -> bool

Return true if there is an edge from a to b, false otherwise. Read more
source§

impl<G: GraphBase> GraphBase for Reversed<G>

§

type NodeId = <G as GraphBase>::NodeId

node identifier
§

type EdgeId = <G as GraphBase>::EdgeId

edge identifier
source§

impl<G> GraphProp for Reversed<G>where G: GraphProp,

§

type EdgeType = <G as GraphProp>::EdgeType

The kind of edges in the graph.
source§

fn is_directed(&self) -> bool

source§

impl<G> IntoEdgeReferences for Reversed<G>where G: IntoEdgeReferences,

source§

impl<G> IntoEdges for Reversed<G>where G: IntoEdgesDirected,

source§

impl<G> IntoEdgesDirected for Reversed<G>where G: IntoEdgesDirected,

source§

impl<G> IntoNeighbors for Reversed<G>where G: IntoNeighborsDirected,

§

type Neighbors = <G as IntoNeighborsDirected>::NeighborsDirected

source§

fn neighbors(self, n: G::NodeId) -> G::NeighborsDirected

Return an iterator of the neighbors of node a.
source§

impl<G> IntoNeighborsDirected for Reversed<G>where G: IntoNeighborsDirected,

source§

impl<G> IntoNodeIdentifiers for Reversed<G>where G: IntoNodeIdentifiers,

source§

impl<G> IntoNodeReferences for Reversed<G>where G: IntoNodeReferences,

source§

impl<G> NodeCount for Reversed<G>where G: NodeCount,

source§

impl<G> NodeIndexable for Reversed<G>where G: NodeIndexable,

source§

fn node_bound(&self) -> usize

Return an upper bound of the node indices in the graph (suitable for the size of a bitmap).
source§

fn to_index(&self, a: Self::NodeId) -> usize

Convert a to an integer index.
source§

fn from_index(&self, i: usize) -> Self::NodeId

Convert i to a node index. i must be a valid value in the graph.
source§

impl<G: Visitable> Visitable for Reversed<G>

§

type Map = <G as Visitable>::Map

The associated map type
source§

fn visit_map(&self) -> G::Map

Create a new visitor map
source§

fn reset_map(&self, map: &mut Self::Map)

Reset the visitor map (and resize to new size of graph if needed)
source§

impl<G: Copy> Copy for Reversed<G>

source§

impl<G: GraphRef> GraphRef for Reversed<G>

source§

impl<G> NodeCompactIndexable for Reversed<G>where G: NodeCompactIndexable,

Auto Trait Implementations§

§

impl<G> RefUnwindSafe for Reversed<G>where G: RefUnwindSafe,

§

impl<G> Send for Reversed<G>where G: Send,

§

impl<G> Sync for Reversed<G>where G: Sync,

§

impl<G> Unpin for Reversed<G>where G: Unpin,

§

impl<G> UnwindSafe for Reversed<G>where G: 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.