pub trait FiniteGraphRef<'a>: GraphTypeRef<'a> {
type NodeIt: GraphIterator<Self, Item = Self::Node>;
type EdgeIt: GraphIterator<Self, Item = Self::Edge>;
// Required methods
fn num_nodes(&self) -> usize;
fn nodes_iter(&self) -> Self::NodeIt;
fn num_edges(&self) -> usize;
fn edges_iter(&self) -> Self::EdgeIt;
fn enodes(&self, e: Self::Edge) -> (Self::Node, Self::Node);
// Provided methods
fn nodes(&self) -> GraphIter<'_, Self, Self::NodeIt> ⓘ
where Self: Sized { ... }
fn edges(&self) -> GraphIter<'_, Self, Self::EdgeIt> ⓘ
where Self: Sized { ... }
}
Expand description
A reference to a basic finite graph.
This trait contains methods with a unrestricted lifetime for self
.
Required Associated Types§
Sourcetype NodeIt: GraphIterator<Self, Item = Self::Node>
type NodeIt: GraphIterator<Self, Item = Self::Node>
Type of an iterator over all nodes.
Sourcetype EdgeIt: GraphIterator<Self, Item = Self::Edge>
type EdgeIt: GraphIterator<Self, Item = Self::Edge>
Type of an iterator over all edges.
Required Methods§
Sourcefn nodes_iter(&self) -> Self::NodeIt
fn nodes_iter(&self) -> Self::NodeIt
Return a graph iterator over all nodes.
Sourcefn edges_iter(&self) -> Self::EdgeIt
fn edges_iter(&self) -> Self::EdgeIt
Return a graph iterator over all edges.
This iterator traverses only the forward edges.
Provided Methods§
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.