Struct MapGraph

Source
pub struct MapGraph<M>(/* private fields */);

Implementations§

Source§

impl<M> MapGraph<M>

Source

pub fn unwrap(self) -> M

Returns the inner Map of this graph.

Trait Implementations§

Source§

impl<'m, N, W, M> DirectedWeightedGraph<'m, N, W> for MapGraph<M>
where M: Map<'m, (N, N), W>, N: 'm + Eq + Clone, W: 'm,

Source§

type AllWeightedEdges = Map<<M as Map<'m, (N, N), W>>::Iter, fn((&'m (N, N), &'m W)) -> (&'m N, &'m N, &'m W)>

An iterator that iterates over all edges.
Source§

type AllWeightedEdgesMut = Map<<M as Map<'m, (N, N), W>>::IterMut, fn((&'m (N, N), &'m mut W)) -> (&'m N, &'m N, &'m mut W)>

An iterator that iterates over all edges, giving mutable access to the weight.
Source§

fn all_edges(&'m self) -> Self::AllWeightedEdges

Returns an iterator over all the edges in this graph.
Source§

fn all_edges_mut(&'m mut self) -> Self::AllWeightedEdgesMut

Returns an iterator over all the ediges in this graph, with mutable access to the weight.
Source§

fn add_edge(&'m mut self, source: N, sink: N, weight: W) -> Option<(N, N, W)>

Adds an edge to this graph.
Source§

fn remove_edge(&'m mut self, source: &N, sink: &N) -> Option<(N, N, W)>

Removes an edge from the graph.
Source§

fn edge_weight(&'m self, source: &N, sink: &N) -> Option<&W>

Gets a borrow to the weight of the requested edge, if it exist. Read more
Source§

fn edge_weight_mut(&'m mut self, source: &N, sink: &N) -> Option<&mut W>

Gets a mutable borrow to the weight of the requested edge, if it exist. Read more
Source§

fn has_edge(&'g self, source: &N, sink: &N) -> bool

Checks if a graph has an edge or not. Read more
Source§

impl<M> From<M> for MapGraph<M>

Source§

fn from(map: M) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<M> Freeze for MapGraph<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for MapGraph<M>
where M: RefUnwindSafe,

§

impl<M> Send for MapGraph<M>
where M: Send,

§

impl<M> Sync for MapGraph<M>
where M: Sync,

§

impl<M> Unpin for MapGraph<M>
where M: Unpin,

§

impl<M> UnwindSafe for MapGraph<M>
where M: UnwindSafe,

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> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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>,

Source§

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>,

Source§

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.