pub trait NavigableGraph: ImmutableGraphContainer + Sized {
type OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where Self: 'a;
type InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where Self: 'a;
type EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex>
where Self: 'a;
Show 13 methods
// Required methods
fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>;
fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>;
fn edges_between(
&self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex,
) -> Self::EdgesBetween<'_>;
// Provided methods
fn contains_edge_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex,
) -> bool { ... }
fn edge_count_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex,
) -> usize { ... }
fn out_degree(&self, node_id: Self::NodeIndex) -> usize { ... }
fn in_degree(&self, node_id: Self::NodeIndex) -> usize { ... }
fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool { ... }
fn is_split_node(&self, node_id: Self::NodeIndex) -> bool { ... }
fn is_join_node(&self, node_id: Self::NodeIndex) -> bool { ... }
}
Expand description
A graph that can be navigated, i.e. that can iterate the neighbors of its nodes.
Required Associated Types§
Sourcetype OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where
Self: 'a
type OutNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>> where Self: 'a
The iterator type used to iterate over the outgoing neighbors of a node.
Sourcetype InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>>
where
Self: 'a
type InNeighbors<'a>: Iterator<Item = Neighbor<Self::NodeIndex, Self::EdgeIndex>> where Self: 'a
The iterator type used to iterate over the incoming neighbors of a node.
Sourcetype EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex>
where
Self: 'a
type EdgesBetween<'a>: Iterator<Item = Self::EdgeIndex> where Self: 'a
The iterator type used to iterate over the edges between two nodes.
Required Methods§
Sourcefn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
fn out_neighbors(&self, node_id: Self::NodeIndex) -> Self::OutNeighbors<'_>
Returns an iterator over the outgoing neighbors of the given node.
Sourcefn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
fn in_neighbors(&self, node_id: Self::NodeIndex) -> Self::InNeighbors<'_>
Returns an iterator over the incoming neighbors of the given node.
Sourcefn edges_between(
&self,
from_node_id: Self::NodeIndex,
to_node_id: Self::NodeIndex,
) -> Self::EdgesBetween<'_>
fn edges_between( &self, from_node_id: Self::NodeIndex, to_node_id: Self::NodeIndex, ) -> Self::EdgesBetween<'_>
Returns an iterator over the edges (from_node_id, to_node_id)
.
Provided Methods§
Sourcefn contains_edge_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex,
) -> bool
fn contains_edge_between( &self, from: Self::NodeIndex, to: Self::NodeIndex, ) -> bool
Returns true if the graph contains an edge (from, to)
.
Sourcefn edge_count_between(
&self,
from: Self::NodeIndex,
to: Self::NodeIndex,
) -> usize
fn edge_count_between( &self, from: Self::NodeIndex, to: Self::NodeIndex, ) -> usize
Returns the amount of edges (from, to)
.
Sourcefn out_degree(&self, node_id: Self::NodeIndex) -> usize
fn out_degree(&self, node_id: Self::NodeIndex) -> usize
Returns the amount of outgoing edges from a node.
Sourcefn in_degree(&self, node_id: Self::NodeIndex) -> usize
fn in_degree(&self, node_id: Self::NodeIndex) -> usize
Returns the amount of incoming edges to a node.
Sourcefn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
fn is_biunivocal_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree == 1 and outdegree == 1.
Sourcefn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
fn is_bivalent_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1 and outdegree > 1.
Sourcefn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_split_edge(&self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s tail has outdegree > 1.
Sourcefn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
fn is_join_edge(&self, edge_id: Self::EdgeIndex) -> bool
Returns true if the given edge’s head has indegree > 1.
Sourcefn is_split_node(&self, node_id: Self::NodeIndex) -> bool
fn is_split_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has outdegree > 1.
Sourcefn is_join_node(&self, node_id: Self::NodeIndex) -> bool
fn is_join_node(&self, node_id: Self::NodeIndex) -> bool
Returns true if the given node has indegree > 1.
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.