Struct petgraph::graph::Frozen
[−]
[src]
pub struct Frozen<'a, G: 'a>(_);
Frozen
only allows shared access (read-only) to the
underlying graph G
, but it allows mutable access to its
node and edge weights.
This is used to ensure immutability of the graph's structure while permitting weights to change.
Methods
impl<'a, G> Frozen<'a, G>
[src]
fn new(gr: &'a mut G) -> Self
impl<'a, N, E, Ty, Ix> Frozen<'a, Graph<N, E, Ty, Ix>> where
Ty: EdgeType,
Ix: IndexType,
[src]
Ty: EdgeType,
Ix: IndexType,
fn index_twice_mut<T, U>(
&mut self,
i: T,
j: U
) -> (&mut <Graph<N, E, Ty, Ix> as Index<T>>::Output, &mut <Graph<N, E, Ty, Ix> as Index<U>>::Output) where
Graph<N, E, Ty, Ix>: IndexMut<T> + IndexMut<U>,
T: GraphIndex,
U: GraphIndex,
&mut self,
i: T,
j: U
) -> (&mut <Graph<N, E, Ty, Ix> as Index<T>>::Output, &mut <Graph<N, E, Ty, Ix> as Index<U>>::Output) where
Graph<N, E, Ty, Ix>: IndexMut<T> + IndexMut<U>,
T: GraphIndex,
U: GraphIndex,
Index the Graph
by two indices, any combination of
node or edge indices is fine.
Panics if the indices are equal or if they are out of bounds.
Trait Implementations
impl<'a, G> GraphBase for Frozen<'a, G> where
G: GraphBase,
[src]
G: GraphBase,
impl<'a, G> Deref for Frozen<'a, G>
[src]
type Target = G
The resulting type after dereferencing
fn deref(&self) -> &G
The method called to dereference a value
impl<'a, G, I> Index<I> for Frozen<'a, G> where
G: Index<I>,
[src]
G: Index<I>,
type Output = G::Output
The returned type after indexing
fn index(&self, i: I) -> &G::Output
The method for the indexing (container[index]
) operation
impl<'a, G, I> IndexMut<I> for Frozen<'a, G> where
G: IndexMut<I>,
[src]
G: IndexMut<I>,
fn index_mut(&mut self, i: I) -> &mut G::Output
The method for the mutable indexing (container[index]
) operation
impl<'a, G> Data for Frozen<'a, G> where
G: Data,
[src]
G: Data,
type NodeWeight = G::NodeWeight
type EdgeWeight = G::EdgeWeight
impl<'a, G> DataMap for Frozen<'a, G> where
G: DataMap,
[src]
G: DataMap,
fn node_weight(&self, id: Self::NodeId) -> Option<&Self::NodeWeight>
fn edge_weight(&self, id: Self::EdgeId) -> Option<&Self::EdgeWeight>
impl<'a, G> DataMapMut for Frozen<'a, G> where
G: DataMapMut,
[src]
G: DataMapMut,
fn node_weight_mut(&mut self, id: Self::NodeId) -> Option<&mut Self::NodeWeight>
fn edge_weight_mut(&mut self, id: Self::EdgeId) -> Option<&mut Self::EdgeWeight>
impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G> where
G: GetAdjacencyMatrix,
[src]
G: GetAdjacencyMatrix,
type AdjMatrix = G::AdjMatrix
The associated adjacency matrix type
fn adjacency_matrix(&self) -> Self::AdjMatrix
Create the adjacency matrix
fn is_adjacent(
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
&self,
matrix: &Self::AdjMatrix,
a: Self::NodeId,
b: Self::NodeId
) -> bool
Return true if there is an edge from a
to b
, false otherwise. Read more
impl<'a, 'b, G> IntoEdgeReferences for &'b Frozen<'a, G> where
G: IntoEdgeReferences,
[src]
G: IntoEdgeReferences,
type EdgeRef = G::EdgeRef
type EdgeReferences = G::EdgeReferences
fn edge_references(self) -> Self::EdgeReferences
impl<'a, 'b, G> IntoEdges for &'b Frozen<'a, G> where
G: IntoEdges,
[src]
G: IntoEdges,
impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G> where
G: IntoNeighbors,
[src]
G: IntoNeighbors,
type Neighbors = G::Neighbors
fn neighbors(self, a: Self::NodeId) -> Self::Neighbors
Return an iterator of the neighbors of node a
.
impl<'a, 'b, G> IntoNeighborsDirected for &'b Frozen<'a, G> where
G: IntoNeighborsDirected,
[src]
G: IntoNeighborsDirected,
type NeighborsDirected = G::NeighborsDirected
fn neighbors_directed(
self,
n: Self::NodeId,
d: Direction
) -> Self::NeighborsDirected
self,
n: Self::NodeId,
d: Direction
) -> Self::NeighborsDirected
impl<'a, 'b, G> IntoNodeIdentifiers for &'b Frozen<'a, G> where
G: IntoNodeIdentifiers,
[src]
G: IntoNodeIdentifiers,
type NodeIdentifiers = G::NodeIdentifiers
fn node_identifiers(self) -> Self::NodeIdentifiers
impl<'a, 'b, G> IntoNodeReferences for &'b Frozen<'a, G> where
G: IntoNodeReferences,
[src]
G: IntoNodeReferences,
type NodeRef = G::NodeRef
type NodeReferences = G::NodeReferences
fn node_references(self) -> Self::NodeReferences
impl<'a, G> NodeCompactIndexable for Frozen<'a, G> where
G: NodeCompactIndexable,
[src]
G: NodeCompactIndexable,
impl<'a, G> NodeCount for Frozen<'a, G> where
G: NodeCount,
[src]
G: NodeCount,
fn node_count(&self) -> usize
impl<'a, G> NodeIndexable for Frozen<'a, G> where
G: NodeIndexable,
[src]
G: NodeIndexable,
fn node_bound(&self) -> usize
Return an upper bound of the node indices in the graph (suitable for the size of a bitmap). Read more
fn to_index(&self, a: Self::NodeId) -> usize
Convert a
to an integer index.
fn from_index(&self, i: usize) -> Self::NodeId
Convert i
to a node index
impl<'a, G> GraphProp for Frozen<'a, G> where
G: GraphProp,
[src]
G: GraphProp,
impl<'a, G> Visitable for Frozen<'a, G> where
G: Visitable,
[src]
G: Visitable,