pub struct MultiWeight<E: EdgeWeight> {
pub primary: E,
pub weights: HashMap<String, E>,
}Expand description
Multi-weight edge for graphs with multiple edge attributes
Fields§
§primary: EPrimary weight
weights: HashMap<String, E>Additional weights with names
Implementations§
Source§impl<E: EdgeWeight> MultiWeight<E>
impl<E: EdgeWeight> MultiWeight<E>
Sourcepub fn add_weight(&mut self, name: String, weight: E)
pub fn add_weight(&mut self, name: String, weight: E)
Add a named weight
Sourcepub fn get_weight(&self, name: &str) -> Option<&E>
pub fn get_weight(&self, name: &str) -> Option<&E>
Get a named weight
Trait Implementations§
Source§impl<E: Clone + EdgeWeight> Clone for MultiWeight<E>
impl<E: Clone + EdgeWeight> Clone for MultiWeight<E>
Source§fn clone(&self) -> MultiWeight<E>
fn clone(&self) -> MultiWeight<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<E> Freeze for MultiWeight<E>where
E: Freeze,
impl<E> RefUnwindSafe for MultiWeight<E>where
E: RefUnwindSafe,
impl<E> Send for MultiWeight<E>
impl<E> Sync for MultiWeight<E>
impl<E> Unpin for MultiWeight<E>where
E: Unpin,
impl<E> UnwindSafe for MultiWeight<E>where
E: UnwindSafe,
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