petgraph::visit

Struct 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>

Source§

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>

Source§

type NodeId = <G as GraphBase>::NodeId

node identifier
Source§

type EdgeId = <G as GraphBase>::EdgeId

edge identifier
Source§

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

Source§

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>

Source§

impl<G> IntoEdges for Reversed<G>

Source§

impl<G> IntoEdgesDirected for Reversed<G>

Source§

impl<G> IntoNeighbors for Reversed<G>

Source§

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>

Source§

impl<G> IntoNodeIdentifiers for Reversed<G>

Source§

impl<G> IntoNodeReferences for Reversed<G>

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>

Source§

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>

Auto Trait Implementations§

§

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

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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

Source§

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.