pub struct Frozen<'a, G>(/* private fields */)
where
G: 'a;
Expand description
Frozen
is a graph wrapper.
The 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 be both read and written.
See indexing implementations and the traits Data
and DataMap
for read-write access to the graph’s weights.
Implementations§
source§impl<'a, N, E, Ty, Ix> Frozen<'a, Graph<N, E, Ty, Ix>>
impl<'a, N, E, Ty, Ix> Frozen<'a, Graph<N, E, Ty, Ix>>
sourcepub 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)
pub 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)
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§
source§impl<'a, G> Data for Frozen<'a, G>where
G: Data,
impl<'a, G> Data for Frozen<'a, G>where
G: Data,
type NodeWeight = <G as Data>::NodeWeight
type EdgeWeight = <G as Data>::EdgeWeight
source§impl<'a, G> DataMap for Frozen<'a, G>where
G: DataMap,
impl<'a, G> DataMap for Frozen<'a, G>where
G: DataMap,
fn node_weight( &self, id: <Frozen<'a, G> as GraphBase>::NodeId ) -> Option<&<Frozen<'a, G> as Data>::NodeWeight>
fn edge_weight( &self, id: <Frozen<'a, G> as GraphBase>::EdgeId ) -> Option<&<Frozen<'a, G> as Data>::EdgeWeight>
source§impl<'a, G> DataMapMut for Frozen<'a, G>where
G: DataMapMut,
impl<'a, G> DataMapMut for Frozen<'a, G>where
G: DataMapMut,
fn node_weight_mut( &mut self, id: <Frozen<'a, G> as GraphBase>::NodeId ) -> Option<&mut <Frozen<'a, G> as Data>::NodeWeight>
fn edge_weight_mut( &mut self, id: <Frozen<'a, G> as GraphBase>::EdgeId ) -> Option<&mut <Frozen<'a, G> as Data>::EdgeWeight>
source§impl<'a, G> Deref for Frozen<'a, G>
impl<'a, G> Deref for Frozen<'a, G>
Deref allows transparent access to all shared reference (read-only) functionality in the underlying graph.
source§impl<'a, G> EdgeCount for Frozen<'a, G>where
G: EdgeCount,
impl<'a, G> EdgeCount for Frozen<'a, G>where
G: EdgeCount,
source§fn edge_count(&self) -> usize
fn edge_count(&self) -> usize
Return the number of edges in the graph.
source§impl<'a, G> EdgeIndexable for Frozen<'a, G>where
G: EdgeIndexable,
impl<'a, G> EdgeIndexable for Frozen<'a, G>where
G: EdgeIndexable,
source§impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G>where
G: GetAdjacencyMatrix,
impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G>where
G: GetAdjacencyMatrix,
§type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix
type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix
The associated adjacency matrix type
source§fn adjacency_matrix(&self) -> <Frozen<'a, G> as GetAdjacencyMatrix>::AdjMatrix
fn adjacency_matrix(&self) -> <Frozen<'a, G> as GetAdjacencyMatrix>::AdjMatrix
Create the adjacency matrix
source§impl<'a, 'b, G> IntoEdgeReferences for &'b Frozen<'a, G>where
G: IntoEdgeReferences,
impl<'a, 'b, G> IntoEdgeReferences for &'b Frozen<'a, G>where
G: IntoEdgeReferences,
type EdgeRef = <G as IntoEdgeReferences>::EdgeRef
type EdgeReferences = <G as IntoEdgeReferences>::EdgeReferences
fn edge_references( self ) -> <&'b Frozen<'a, G> as IntoEdgeReferences>::EdgeReferences
source§impl<'a, 'b, G> IntoEdgesDirected for &'b Frozen<'a, G>where
G: IntoEdgesDirected,
impl<'a, 'b, G> IntoEdgesDirected for &'b Frozen<'a, G>where
G: IntoEdgesDirected,
type EdgesDirected = <G as IntoEdgesDirected>::EdgesDirected
fn edges_directed( self, a: <&'b Frozen<'a, G> as GraphBase>::NodeId, dir: Direction ) -> <&'b Frozen<'a, G> as IntoEdgesDirected>::EdgesDirected
source§impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G>where
G: IntoNeighbors,
impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G>where
G: IntoNeighbors,
source§impl<'a, 'b, G> IntoNeighborsDirected for &'b Frozen<'a, G>where
G: IntoNeighborsDirected,
impl<'a, 'b, G> IntoNeighborsDirected for &'b Frozen<'a, G>where
G: IntoNeighborsDirected,
type NeighborsDirected = <G as IntoNeighborsDirected>::NeighborsDirected
fn neighbors_directed( self, n: <&'b Frozen<'a, G> as GraphBase>::NodeId, d: Direction ) -> <&'b Frozen<'a, G> as IntoNeighborsDirected>::NeighborsDirected
source§impl<'a, 'b, G> IntoNodeIdentifiers for &'b Frozen<'a, G>where
G: IntoNodeIdentifiers,
impl<'a, 'b, G> IntoNodeIdentifiers for &'b Frozen<'a, G>where
G: IntoNodeIdentifiers,
type NodeIdentifiers = <G as IntoNodeIdentifiers>::NodeIdentifiers
fn node_identifiers( self ) -> <&'b Frozen<'a, G> as IntoNodeIdentifiers>::NodeIdentifiers
source§impl<'a, 'b, G> IntoNodeReferences for &'b Frozen<'a, G>where
G: IntoNodeReferences,
impl<'a, 'b, G> IntoNodeReferences for &'b Frozen<'a, G>where
G: IntoNodeReferences,
type NodeRef = <G as IntoNodeReferences>::NodeRef
type NodeReferences = <G as IntoNodeReferences>::NodeReferences
fn node_references( self ) -> <&'b Frozen<'a, G> as IntoNodeReferences>::NodeReferences
source§impl<'a, G> NodeCount for Frozen<'a, G>where
G: NodeCount,
impl<'a, G> NodeCount for Frozen<'a, G>where
G: NodeCount,
fn node_count(&self) -> usize
source§impl<'a, G> NodeIndexable for Frozen<'a, G>where
G: NodeIndexable,
impl<'a, G> NodeIndexable for Frozen<'a, G>where
G: NodeIndexable,
impl<'a, G> NodeCompactIndexable for Frozen<'a, G>where
G: NodeCompactIndexable,
Auto Trait Implementations§
impl<'a, G> RefUnwindSafe for Frozen<'a, G>where
G: RefUnwindSafe,
impl<'a, G> Send for Frozen<'a, G>where
G: Send,
impl<'a, G> Sync for Frozen<'a, G>where
G: Sync,
impl<'a, G> Unpin for Frozen<'a, G>
impl<'a, G> !UnwindSafe for Frozen<'a, G>
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.