Struct EdgeFiltered

Source
pub struct EdgeFiltered<'a, G, F>
where G: Graph + ?Sized, F: Fn(&G::Node, &G::Edge) -> bool + 'a,
{ /* private fields */ }

Trait Implementations§

Source§

impl<'a, G, F> Clone for EdgeFiltered<'a, G, F>
where G: Graph + ?Sized + Clone, F: Fn(&G::Node, &G::Edge) -> bool + 'a + Clone,

Source§

fn clone(&self) -> EdgeFiltered<'a, 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<'a, G, F> Debug for EdgeFiltered<'a, G, F>
where G: Graph + ?Sized + Debug, F: Fn(&G::Node, &G::Edge) -> bool + 'a + Debug,

Source§

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

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

impl<'a, G, F> Graph for EdgeFiltered<'a, G, F>
where G: Graph + ?Sized, F: Fn(&G::Node, &G::Edge) -> bool + 'a,

Source§

type Node = <G as Graph>::Node

Source§

type Edge = <G as Graph>::Edge

Source§

fn nodes<'b>(&'b self) -> Box<dyn Iterator<Item = G::Node> + 'b>

Source§

fn out_edges<'b>( &'b self, u: &Self::Node, ) -> Box<dyn Iterator<Item = G::Edge> + 'b>

Source§

fn in_edges<'b>( &'b self, u: &Self::Node, ) -> Box<dyn Iterator<Item = G::Edge> + 'b>

Source§

fn out_neighbors<'a>( &'a self, u: &Self::Node, ) -> Map<Box<dyn Iterator<Item = Self::Edge> + 'a>, fn(Self::Edge) -> Self::Node>

Source§

fn in_neighbors<'a>( &'a self, u: &Self::Node, ) -> Map<Box<dyn Iterator<Item = Self::Edge> + 'a>, fn(Self::Edge) -> Self::Node>

Source§

fn dfs<'a>(&'a self) -> Dfs<'a, Self>

Source§

fn dfs_from<'a>(&'a self, root: &Self::Node) -> Dfs<'a, Self>

Source§

fn has_path(&self, u: &Self::Node, v: &Self::Node) -> bool

Source§

fn tarjan(&self) -> Partition<Self>

Source§

fn weak_components(&self) -> Partition<Self>

Source§

fn doubled<'a>(&'a self) -> Doubled<'a, Self>

Returns the graph that has edges in both directions for every edge that this graph has in one direction.
Source§

fn node_filtered<'a, F>(&'a self, predicate: F) -> NodeFiltered<'a, Self, F>
where F: Fn(&Self::Node) -> bool,

Returns the subgraph of this graph that is induced by the set of nodes for which predicate returns true.
Source§

fn edge_filtered<'a, F>(&'a self, predicate: F) -> EdgeFiltered<'a, Self, F>
where F: Fn(&Self::Node, &Self::Edge) -> bool,

Returns the subgraph of this graph containing all the edges for which the predicate returns true.
Source§

fn top_sort<'a>(&'a self) -> Option<Vec<Self::Node>>

If this graph is acyclic, returns a topological sort of the vertices. Otherwise, returns None.
Source§

fn linear_order<'a>(&'a self) -> Option<Vec<Self::Node>>

Source§

fn neighbor_set<'a, I: Iterator<Item = &'a Self::Node>>( &self, set: I, ) -> HashSet<Self::Node>
where Self::Node: 'a,

Returns the set of all nodes that are adjacent (either an in-neighbor or an out-neighbor) to something in set.
Source§

impl<'a, G, F> Copy for EdgeFiltered<'a, G, F>
where G: Graph + ?Sized + Copy, F: Fn(&G::Node, &G::Edge) -> bool + 'a + Copy,

Auto Trait Implementations§

§

impl<'a, G, F> Freeze for EdgeFiltered<'a, G, F>
where F: Freeze, G: ?Sized,

§

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

§

impl<'a, G, F> Send for EdgeFiltered<'a, G, F>
where F: Send, G: Sync + ?Sized,

§

impl<'a, G, F> Sync for EdgeFiltered<'a, G, F>
where F: Sync, G: Sync + ?Sized,

§

impl<'a, G, F> Unpin for EdgeFiltered<'a, G, F>
where F: Unpin, G: ?Sized,

§

impl<'a, G, F> UnwindSafe for EdgeFiltered<'a, G, F>
where F: UnwindSafe, G: RefUnwindSafe + ?Sized,

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, dest: *mut u8)

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

impl<N> Edge<N> for N
where N: Copy,

Source§

fn target(&self) -> N

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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