pub trait ImmutableGraphContainer: GraphBase {
    type NodeIndices<'a>: Iterator<Item = Self::NodeIndex>
       where Self: 'a;
    type EdgeIndices<'a>: Iterator<Item = Self::EdgeIndex>
       where Self: 'a;
    type NodeIndicesCopied: Iterator<Item = Self::NodeIndex>;
    type EdgeIndicesCopied: Iterator<Item = Self::EdgeIndex>;

Show 13 methods // Required methods fn node_indices(&self) -> Self::NodeIndices<'_>; fn edge_indices(&self) -> Self::EdgeIndices<'_>; fn node_indices_copied(&self) -> Self::NodeIndicesCopied; fn edge_indices_copied(&self) -> Self::EdgeIndicesCopied; 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 edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>; // Provided methods fn is_empty(&self) -> bool { ... } fn do_all_edges_endpoints_exist(&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 Associated Types§

source

type NodeIndices<'a>: Iterator<Item = Self::NodeIndex> where Self: 'a

An iterator type over the node indices in this graph.

source

type EdgeIndices<'a>: Iterator<Item = Self::EdgeIndex> where Self: 'a

An iterator type over the edge indices in this graph.

source

type NodeIndicesCopied: Iterator<Item = Self::NodeIndex>

An iterator type over the node indices in this graph. The iterator is independent of the lifetime of self, and hence allows concurrent modifications during iteration. Note that any modification to the graph is not reflected in the iterator after construction.

source

type EdgeIndicesCopied: Iterator<Item = Self::EdgeIndex>

An iterator type over the edge indices in this graph. The iterator is independent of the lifetime of self, and hence allows concurrent modifications during iteration. Note that any modification to the graph is not reflected in the iterator after construction.

Required Methods§

source

fn node_indices(&self) -> Self::NodeIndices<'_>

Returns an iterator over the node indices in this graph.

source

fn edge_indices(&self) -> Self::EdgeIndices<'_>

Returns an iterator over the edge indices in this graph.

source

fn node_indices_copied(&self) -> Self::NodeIndicesCopied

Returns an iterator over the node indices in this graph. The iterator is independent of the lifetime of self, and hence allows concurrent modifications during iteration. Note that any modification to the graph is not reflected in the iterator after construction.

source

fn edge_indices_copied(&self) -> Self::EdgeIndicesCopied

Returns an iterator over the edge indices in this graph. The iterator is independent of the lifetime of self, and hence allows concurrent modifications during iteration. Note that any modification to the graph is not reflected in the iterator after construction.

source

fn contains_node_index(&self, node_id: Self::NodeIndex) -> bool

Returns true if this graph contains the given node index.

source

fn contains_edge_index(&self, edge_id: Self::EdgeIndex) -> bool

Returns true if this graph contains the given edge index.

source

fn node_count(&self) -> usize

Returns the amount of nodes in this graph.

source

fn edge_count(&self) -> usize

Returns the amount of edges in this graph.

source

fn node_data(&self, node_id: Self::NodeIndex) -> &Self::NodeData

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

source

fn edge_data(&self, edge_id: Self::EdgeIndex) -> &Self::EdgeData

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

source

fn edge_endpoints(&self, edge_id: Self::EdgeIndex) -> Edge<Self::NodeIndex>

Returns the endpoints of an edge.

Provided Methods§

source

fn is_empty(&self) -> bool

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

source

fn do_all_edges_endpoints_exist(&self) -> bool

Returns true if the nodes returned by edge_endpoints are part of the graph for all edges.

Implementors§

source§

impl<'a, Graph: ImmutableGraphContainer> ImmutableGraphContainer for InducedBitVectorSubgraph<'a, Graph>

§

type NodeIndices<'node_indices> = Filter<<Graph as ImmutableGraphContainer>::NodeIndices<'node_indices>, Box<dyn Fn(&<Graph as GraphBase>::NodeIndex) -> bool + 'node_indices, Global>> where Self: 'node_indices, Graph: 'node_indices

§

type EdgeIndices<'edge_indices> = Filter<<Graph as ImmutableGraphContainer>::EdgeIndices<'edge_indices>, Box<dyn Fn(&<Graph as GraphBase>::EdgeIndex) -> bool + 'edge_indices, Global>> where Self: 'edge_indices, Graph: 'edge_indices

§

type NodeIndicesCopied = IntoIter<<Graph as GraphBase>::NodeIndex, Global>

§

type EdgeIndicesCopied = IntoIter<<Graph as GraphBase>::EdgeIndex, Global>

source§

impl<Graph: ImmutableGraphContainer + SubgraphBase> ImmutableGraphContainer for InvertedSubgraph<'_, Graph>where <Graph as SubgraphBase>::RootGraph: ImmutableGraphContainer,

source§

impl<Graph: ImmutableGraphContainer> ImmutableGraphContainer for BitVectorSubgraph<'_, Graph>

§

type NodeIndices<'a> = Filter<<Graph as ImmutableGraphContainer>::NodeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::NodeIndex) -> bool + 'a, Global>> where Self: 'a, Graph: 'a

§

type EdgeIndices<'a> = Filter<<Graph as ImmutableGraphContainer>::EdgeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::EdgeIndex) -> bool + 'a, Global>> where Self: 'a, Graph: 'a

§

type NodeIndicesCopied = IntoIter<<Graph as GraphBase>::NodeIndex, Global>

§

type EdgeIndicesCopied = IntoIter<<Graph as GraphBase>::EdgeIndex, Global>

source§

impl<Graph: ImmutableGraphContainer> ImmutableGraphContainer for IncrementalSubgraph<'_, Graph>

§

type NodeIndices<'a> = Filter<<Graph as ImmutableGraphContainer>::NodeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::NodeIndex) -> bool + 'a, Global>> where Self: 'a

§

type EdgeIndices<'a> = Filter<<Graph as ImmutableGraphContainer>::EdgeIndices<'a>, Box<dyn Fn(&<Graph as GraphBase>::EdgeIndex) -> bool + 'a, Global>> where Self: 'a

§

type NodeIndicesCopied = IntoIter<<Graph as GraphBase>::NodeIndex, Global>

§

type EdgeIndicesCopied = IntoIter<<Graph as GraphBase>::EdgeIndex, Global>

source§

impl<Graph: ImmutableGraphContainer> ImmutableGraphContainer for InducedIncrementalSubgraph<'_, Graph>

source§

impl<NodeData, EdgeData> ImmutableGraphContainer for PetGraph<NodeData, EdgeData>

§

type NodeIndices<'a> = GraphIndices<<PetGraph<NodeData, EdgeData> as GraphBase>::NodeIndex, <PetGraph<NodeData, EdgeData> as GraphBase>::OptionalNodeIndex> where Self: 'a

§

type EdgeIndices<'a> = GraphIndices<<PetGraph<NodeData, EdgeData> as GraphBase>::EdgeIndex, <PetGraph<NodeData, EdgeData> as GraphBase>::OptionalEdgeIndex> where Self: 'a

§

type NodeIndicesCopied = GraphIndices<<PetGraph<NodeData, EdgeData> as GraphBase>::NodeIndex, <PetGraph<NodeData, EdgeData> as GraphBase>::OptionalNodeIndex>

§

type EdgeIndicesCopied = GraphIndices<<PetGraph<NodeData, EdgeData> as GraphBase>::EdgeIndex, <PetGraph<NodeData, EdgeData> as GraphBase>::OptionalEdgeIndex>

source§

impl<NodeIndex: GraphIndex<OptionalNodeIndex>, OptionalNodeIndex: OptionalGraphIndex<NodeIndex>, EdgeIndex: GraphIndex<OptionalEdgeIndex>, OptionalEdgeIndex: OptionalGraphIndex<EdgeIndex>, Graph0: ImmutableGraphContainer + SubgraphBase + GraphBase<NodeIndex = NodeIndex, OptionalNodeIndex = OptionalNodeIndex, EdgeIndex = EdgeIndex, OptionalEdgeIndex = OptionalEdgeIndex>, Graph1: ImmutableGraphContainer + SubgraphBase + GraphBase<NodeIndex = NodeIndex, OptionalNodeIndex = OptionalNodeIndex, EdgeIndex = EdgeIndex, OptionalEdgeIndex = OptionalEdgeIndex>> ImmutableGraphContainer for UnionSubgraph<'_, Graph0, Graph1>where <Self as SubgraphBase>::RootGraph: ImmutableGraphContainer,

§

type NodeIndices<'a> = UnionIndexIterator<NodeIndex, OptionalNodeIndex, <Graph0 as ImmutableGraphContainer>::NodeIndices<'a>, <Graph1 as ImmutableGraphContainer>::NodeIndices<'a>> where Self: 'a

§

type EdgeIndices<'a> = UnionIndexIterator<EdgeIndex, OptionalEdgeIndex, <Graph0 as ImmutableGraphContainer>::EdgeIndices<'a>, <Graph1 as ImmutableGraphContainer>::EdgeIndices<'a>> where Self: 'a

§

type NodeIndicesCopied = UnionIndexIterator<NodeIndex, OptionalNodeIndex, <Graph0 as ImmutableGraphContainer>::NodeIndicesCopied, <Graph1 as ImmutableGraphContainer>::NodeIndicesCopied>

§

type EdgeIndicesCopied = UnionIndexIterator<EdgeIndex, OptionalEdgeIndex, <Graph0 as ImmutableGraphContainer>::EdgeIndicesCopied, <Graph1 as ImmutableGraphContainer>::EdgeIndicesCopied>