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

Returns an iterator over the node indices in this graph.

Returns an iterator over the edge indices in this graph.

Returns true if this graph contains the given node index.

Returns true if this graph contains the given edge index.

Returns the amount of nodes in this graph.

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.

Returns a mutable reference to the node data associated with the given node id, or None if there is no such node.

Returns a mutable reference to the edge data associated with the given edge id, or None if there is no such edge.

Returns true if the graph contains an edge (from, to).

Returns the amount of edges (from, to).

Returns the endpoints of an edge.

Provided methods

Returns true if the graph is empty, i.e. contains no nodes or edges.

Implementations on Foreign Types

Implementors