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, G> Frozen<'a, G>

source

pub fn new(gr: &'a mut G) -> Frozen<'a, G>

Create a new Frozen from a mutable reference to a graph.

source§

impl<'a, N, E, Ty, Ix> Frozen<'a, Graph<N, E, Ty, Ix>>
where Ty: EdgeType, Ix: IndexType,

source

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)
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§

source§

impl<'a, G> Data for Frozen<'a, G>
where G: Data,

source§

impl<'a, G> DataMap for Frozen<'a, G>
where G: DataMap,

source§

fn node_weight( &self, id: <Frozen<'a, G> as GraphBase>::NodeId ) -> Option<&<Frozen<'a, G> as Data>::NodeWeight>

source§

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,

source§

fn node_weight_mut( &mut self, id: <Frozen<'a, G> as GraphBase>::NodeId ) -> Option<&mut <Frozen<'a, G> as Data>::NodeWeight>

source§

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>

Deref allows transparent access to all shared reference (read-only) functionality in the underlying graph.

§

type Target = G

The resulting type after dereferencing.
source§

fn deref(&self) -> &G

Dereferences the value.
source§

impl<'a, G> EdgeCount for Frozen<'a, G>
where G: EdgeCount,

source§

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,

source§

fn edge_bound(&self) -> usize

Return an upper bound of the edge indices in the graph (suitable for the size of a bitmap).
source§

fn to_index(&self, a: <Frozen<'a, G> as GraphBase>::EdgeId) -> usize

Convert a to an integer index.
source§

fn from_index(&self, i: usize) -> <Frozen<'a, G> as GraphBase>::EdgeId

Convert i to an edge index. i must be a valid value in the graph.
source§

impl<'a, G> GetAdjacencyMatrix for Frozen<'a, G>

§

type AdjMatrix = <G as GetAdjacencyMatrix>::AdjMatrix

The associated adjacency matrix type
source§

fn adjacency_matrix(&self) -> <Frozen<'a, G> as GetAdjacencyMatrix>::AdjMatrix

Create the adjacency matrix
source§

fn is_adjacent( &self, matrix: &<Frozen<'a, G> as GetAdjacencyMatrix>::AdjMatrix, a: <Frozen<'a, G> as GraphBase>::NodeId, b: <Frozen<'a, G> as GraphBase>::NodeId ) -> bool

Return true if there is an edge from a to b, false otherwise. Read more
source§

impl<'a, G> GraphBase for Frozen<'a, G>
where G: GraphBase,

§

type NodeId = <G as GraphBase>::NodeId

node identifier
§

type EdgeId = <G as GraphBase>::EdgeId

edge identifier
source§

impl<'a, G> GraphProp for Frozen<'a, G>
where G: GraphProp,

§

type EdgeType = <G as GraphProp>::EdgeType

The kind of edges in the graph.
source§

fn is_directed(&self) -> bool

source§

impl<'a, G, I> Index<I> for Frozen<'a, G>
where G: Index<I>,

§

type Output = <G as Index<I>>::Output

The returned type after indexing.
source§

fn index(&self, i: I) -> &<G as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, G, I> IndexMut<I> for Frozen<'a, G>
where G: IndexMut<I>,

source§

fn index_mut(&mut self, i: I) -> &mut <G as Index<I>>::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, 'b, G> IntoEdgeReferences for &'b Frozen<'a, G>

source§

impl<'a, 'b, G> IntoEdges for &'b Frozen<'a, G>
where G: IntoEdges,

§

type Edges = <G as IntoEdges>::Edges

source§

fn edges( self, a: <&'b Frozen<'a, G> as GraphBase>::NodeId ) -> <&'b Frozen<'a, G> as IntoEdges>::Edges

source§

impl<'a, 'b, G> IntoEdgesDirected for &'b Frozen<'a, G>

source§

impl<'a, 'b, G> IntoNeighbors for &'b Frozen<'a, G>
where G: IntoNeighbors,

§

type Neighbors = <G as IntoNeighbors>::Neighbors

source§

fn neighbors( self, a: <&'b Frozen<'a, G> as GraphBase>::NodeId ) -> <&'b Frozen<'a, G> as IntoNeighbors>::Neighbors

Return an iterator of the neighbors of node a.
source§

impl<'a, 'b, G> IntoNeighborsDirected for &'b Frozen<'a, G>

source§

impl<'a, 'b, G> IntoNodeIdentifiers for &'b Frozen<'a, G>

source§

impl<'a, 'b, G> IntoNodeReferences for &'b Frozen<'a, G>

source§

impl<'a, G> NodeCount for Frozen<'a, G>
where G: NodeCount,

source§

impl<'a, G> NodeIndexable for Frozen<'a, G>
where G: NodeIndexable,

source§

fn node_bound(&self) -> usize

Return an upper bound of the node indices in the graph (suitable for the size of a bitmap).
source§

fn to_index(&self, a: <Frozen<'a, G> as GraphBase>::NodeId) -> usize

Convert a to an integer index.
source§

fn from_index(&self, i: usize) -> <Frozen<'a, G> as GraphBase>::NodeId

Convert i to a node index. i must be a valid value in the graph.
source§

impl<'a, G> Visitable for Frozen<'a, G>
where G: Visitable,

§

type Map = <G as Visitable>::Map

The associated map type
source§

fn visit_map(&self) -> <Frozen<'a, G> as Visitable>::Map

Create a new visitor map
source§

fn reset_map(&self, map: &mut <Frozen<'a, G> as Visitable>::Map)

Reset the visitor map (and resize to new size of graph if needed)
source§

impl<'a, G> NodeCompactIndexable for Frozen<'a, G>

Auto Trait Implementations§

§

impl<'a, G> Freeze for Frozen<'a, G>

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more