Skip to main content

FilterNodes

Struct FilterNodes 

Source
pub struct FilterNodes<G, F> { /* private fields */ }
Expand description

A graph whose nodes are being filtered by the predicate F.

Created by the Graph::filter_nodes trait method.

Trait Implementations§

Source§

impl<G, F> Debug for FilterNodes<G, F>
where G: Debug,

Source§

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

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

impl<G, F, Node> Graph<Node> for FilterNodes<G, F>
where G: Graph<Node>, F: Fn(&Node) -> bool,

Source§

type NodesIter<'a> = Filter<<G as Graph<Node>>::NodesIter<'a>, &'a F> where Self: 'a

The iterator type returned by Nodes::nodes.
Source§

type SuccessorsIter<'a> = Filter<<G as Graph<Node>>::SuccessorsIter<'a>, &'a F> where Self: 'a

The iterator type returned by Successors::successors.
Source§

fn nodes(&self) -> Self::NodesIter<'_>

Iterate over the nodes in this graph.
Source§

fn successors(&self, node: Node) -> Self::SuccessorsIter<'_>

Iterate over the successors of the given node.
Source§

fn by_ref(&self) -> &Self

Like Iterator::by_ref but for Graph.
Source§

fn filter_nodes<F>(self, predicate: F) -> FilterNodes<Self, F>
where Self: Sized, F: Fn(&Node) -> bool,

Use the given predicate to filter out certain nodes from the graph.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<G, F> UnwindSafe for FilterNodes<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> 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> Same for T

Source§

type Output = T

Should always be Self
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.