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]
fn node_weight_mut(&mut self, a: NodeIndex<Ix>) -> Option<&mut N>
Access the weight for node a
, mutably.
Also available with indexing syntax: &mut graph[a]
.
fn edge_weight_mut(&mut self, e: EdgeIndex<Ix>) -> Option<&mut E>
Access the weight for edge e
, mutably.
Also available with indexing syntax: &mut graph[e]
.
fn index_twice_mut<T, U>(&mut self, i: T, j: U) -> (&mut Graph<N, E, Ty, Ix>::Output, &mut Graph<N, E, Ty, Ix>::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> 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]
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]
fn index_mut(&mut self, i: I) -> &mut G::Output
The method for the mutable indexing (container[index]
) operation
impl<'a, G> GraphBase for Frozen<'a, G> where G: GraphBase
[src]
impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G> where &'b G: IntoNeighbors, G: GraphBase<NodeId=&'b G::NodeId>
[src]
type Neighbors = &'b G::Neighbors
fn neighbors(self, n: G::NodeId) -> Self::Neighbors
Return an iterator of the neighbors of node a
.