Struct petgraph::visit::EdgeFiltered

source ·
pub struct EdgeFiltered<G, F>(pub G, pub F);
Expand description

An edge-filtering graph adaptor.

The adaptor may filter out edges. The filter implements the trait FilterEdge. Closures of type Fn(G::EdgeRef) -> bool already implement this trait.

The filter may use edge source, target, id, and weight to select whether to include the edge or not.

Tuple Fields§

§0: G§1: F

Implementations§

source§

impl<F, G> EdgeFiltered<G, F>
where G: IntoEdgeReferences, F: Fn(G::EdgeRef) -> bool,

source

pub fn from_fn(graph: G, filter: F) -> Self

Create an EdgeFiltered adaptor from the closure filter.

Trait Implementations§

source§

impl<G: Clone, F: Clone> Clone for EdgeFiltered<G, F>

source§

fn clone(&self) -> EdgeFiltered<G, F>

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, F> Data for EdgeFiltered<G, F>
where G: Data,

source§

impl<G: Debug, F: Debug> Debug for EdgeFiltered<G, F>

source§

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

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

impl<G, F> EdgeIndexable for EdgeFiltered<G, F>
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, F> GraphBase for EdgeFiltered<G, F>
where G: GraphBase,

§

type NodeId = <G as GraphBase>::NodeId

node identifier
§

type EdgeId = <G as GraphBase>::EdgeId

edge identifier
source§

impl<G, F> GraphProp for EdgeFiltered<G, F>
where G: GraphProp,

§

type EdgeType = <G as GraphProp>::EdgeType

The kind of edges in the graph.
source§

fn is_directed(&self) -> bool

source§

impl<'a, G, F> IntoEdgeReferences for &'a EdgeFiltered<G, F>

source§

impl<'a, G, F> IntoEdges for &'a EdgeFiltered<G, F>
where G: IntoEdges, F: FilterEdge<G::EdgeRef>,

§

type Edges = EdgeFilteredEdges<'a, G, <G as IntoEdges>::Edges, F>

source§

fn edges(self, n: G::NodeId) -> Self::Edges

source§

impl<'a, G, F> IntoEdgesDirected for &'a EdgeFiltered<G, F>

source§

impl<'a, G, F> IntoNeighbors for &'a EdgeFiltered<G, F>
where G: IntoEdges, F: FilterEdge<G::EdgeRef>,

§

type Neighbors = EdgeFilteredNeighbors<'a, G, F>

source§

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

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

impl<'a, G, F> IntoNeighborsDirected for &'a EdgeFiltered<G, F>

source§

impl<'a, G, F> IntoNodeIdentifiers for &'a EdgeFiltered<G, F>

source§

impl<'a, G, F> IntoNodeReferences for &'a EdgeFiltered<G, F>

source§

impl<G, F> NodeCount for EdgeFiltered<G, F>
where G: NodeCount,

source§

impl<G, F> NodeIndexable for EdgeFiltered<G, F>
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, F> Visitable for EdgeFiltered<G, F>
where G: Visitable,

§

type Map = <G as Visitable>::Map

The associated map type
source§

fn visit_map(&self) -> Self::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, F: Copy> Copy for EdgeFiltered<G, F>

source§

impl<G, F> NodeCompactIndexable for EdgeFiltered<G, F>

Auto Trait Implementations§

§

impl<G, F> Freeze for EdgeFiltered<G, F>
where G: Freeze, F: Freeze,

§

impl<G, F> RefUnwindSafe for EdgeFiltered<G, F>

§

impl<G, F> Send for EdgeFiltered<G, F>
where G: Send, F: Send,

§

impl<G, F> Sync for EdgeFiltered<G, F>
where G: Sync, F: Sync,

§

impl<G, F> Unpin for EdgeFiltered<G, F>
where G: Unpin, F: Unpin,

§

impl<G, F> UnwindSafe for EdgeFiltered<G, F>
where G: UnwindSafe, F: 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: Copy,

source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

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

source§

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

🔬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,

§

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

§

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

§

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.