pub struct EdgeWeightMap { /* private fields */ }Expand description
A map of WeightedEdge instances keyed by (from, to) tuple.
Implementations§
Source§impl EdgeWeightMap
impl EdgeWeightMap
Sourcepub fn insert(&mut self, edge: WeightedEdge)
pub fn insert(&mut self, edge: WeightedEdge)
Inserts a WeightedEdge. Overwrites any existing edge for (from, to).
Sourcepub fn get(&self, from: u64, to: u64) -> Option<&WeightedEdge>
pub fn get(&self, from: u64, to: u64) -> Option<&WeightedEdge>
Returns the edge between from and to if it exists.
Sourcepub fn min_weight(&self) -> Option<&WeightedEdge>
pub fn min_weight(&self) -> Option<&WeightedEdge>
Returns the edge with the smallest bandwidth_bps, or None if empty.
Sourcepub fn bottleneck_edges(&self) -> Vec<&WeightedEdge>
pub fn bottleneck_edges(&self) -> Vec<&WeightedEdge>
Returns all edges that are considered bottlenecks.
Trait Implementations§
Source§impl Clone for EdgeWeightMap
impl Clone for EdgeWeightMap
Source§fn clone(&self) -> EdgeWeightMap
fn clone(&self) -> EdgeWeightMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EdgeWeightMap
impl Debug for EdgeWeightMap
Source§impl Default for EdgeWeightMap
impl Default for EdgeWeightMap
Source§fn default() -> EdgeWeightMap
fn default() -> EdgeWeightMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EdgeWeightMap
impl RefUnwindSafe for EdgeWeightMap
impl Send for EdgeWeightMap
impl Sync for EdgeWeightMap
impl Unpin for EdgeWeightMap
impl UnsafeUnpin for EdgeWeightMap
impl UnwindSafe for EdgeWeightMap
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more