pub trait Graph<Node> {
type NodesIter<'a>: Iterator<Item = Node>
where Self: 'a;
type SuccessorsIter<'a>: Iterator<Item = Node>
where Self: 'a;
// Required methods
fn nodes(&self) -> Self::NodesIter<'_>;
fn successors(&self, node: Node) -> Self::SuccessorsIter<'_>;
// Provided methods
fn by_ref(&self) -> &Self { ... }
fn filter_nodes<F>(self, predicate: F) -> FilterNodes<Self, F>
where Self: Sized,
F: Fn(&Node) -> bool { ... }
}Expand description
A trait for any kind of graph data structure.
Required Associated Types§
Sourcetype NodesIter<'a>: Iterator<Item = Node>
where
Self: 'a
type NodesIter<'a>: Iterator<Item = Node> where Self: 'a
The iterator type returned by Nodes::nodes.
Sourcetype SuccessorsIter<'a>: Iterator<Item = Node>
where
Self: 'a
type SuccessorsIter<'a>: Iterator<Item = Node> where Self: 'a
The iterator type returned by Successors::successors.
Required Methods§
Sourcefn successors(&self, node: Node) -> Self::SuccessorsIter<'_>
fn successors(&self, node: Node) -> Self::SuccessorsIter<'_>
Iterate over the successors of the given node.
Provided Methods§
Sourcefn filter_nodes<F>(self, predicate: F) -> FilterNodes<Self, F>
fn filter_nodes<F>(self, predicate: F) -> FilterNodes<Self, F>
Use the given predicate to filter out certain nodes from the graph.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.