Trait traitgraph::interface::ImmutableGraphContainer [−][src]
pub trait ImmutableGraphContainer: GraphBase {
Show 14 methods
fn node_indices(
&self
) -> GraphIndices<Self::NodeIndex, Self::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
;
fn edge_indices(
&self
) -> GraphIndices<Self::EdgeIndex, Self::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
;
fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool;
fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool;
fn node_count(&self) -> usize;
fn edge_count(&self) -> usize;
fn node_data(&self, node_id: Self::NodeIndex) -> &Self::NodeData;
fn edge_data(&self, edge_id: Self::EdgeIndex) -> &Self::EdgeData;
fn node_data_mut(&mut self, node_id: Self::NodeIndex) -> &mut Self::NodeData;
fn edge_data_mut(&mut self, edge_id: Self::EdgeIndex) -> &mut Self::EdgeData;
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 edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>;
fn is_empty(&self) -> bool { ... }
}
Expand description
A container that contains a set of nodes and edges.
Graphs that implement this trait must have their nodes and edges indexed consecutively.
Required methods
fn node_indices(&self) -> GraphIndices<Self::NodeIndex, Self::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
fn node_indices(&self) -> GraphIndices<Self::NodeIndex, Self::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
Returns an iterator over the node indices in this graph.
fn edge_indices(&self) -> GraphIndices<Self::EdgeIndex, Self::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
fn edge_indices(&self) -> GraphIndices<Self::EdgeIndex, Self::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
Returns an iterator over the edge indices in this graph.
fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool
fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool
Returns true if this graph contains the given node index.
fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool
fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool
Returns true if this graph contains the given edge index.
fn node_count(&self) -> usize
fn node_count(&self) -> usize
Returns the amount of nodes in this graph.
fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Returns the amount of edges in this graph.
Returns a reference to the node data associated with the given node id, or None if there is no such node.
Returns a reference to the edge data associated with the given edge id, or None if there is no such edge.
fn node_data_mut(&mut self, node_id: Self::NodeIndex) -> &mut Self::NodeData
fn node_data_mut(&mut self, node_id: Self::NodeIndex) -> &mut Self::NodeData
Returns a mutable reference to the node data associated with the given node id, or None if there is no such node.
fn edge_data_mut(&mut self, edge_id: Self::EdgeIndex) -> &mut Self::EdgeData
fn edge_data_mut(&mut self, edge_id: Self::EdgeIndex) -> &mut Self::EdgeData
Returns a mutable reference to the edge data associated with the given edge id, or None if there is no such edge.
fn 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)
.
fn 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)
.
fn edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>
fn edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>
Returns the endpoints of an edge.
Provided methods
Implementations on Foreign Types
fn node_indices(&self) -> GraphIndices<Self::NodeIndex, Self::OptionalNodeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
fn edge_indices(&self) -> GraphIndices<Self::EdgeIndex, Self::OptionalEdgeIndex>ⓘNotable traits for GraphIndices<IndexType, OptionalIndexType>impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;
impl<OptionalIndexType: OptionalGraphIndex<IndexType>, IndexType: GraphIndex<OptionalIndexType>> Iterator for GraphIndices<IndexType, OptionalIndexType> type Item = IndexType;