pub trait HyperNode<T>: RawNode<T> {
// Required methods
fn index(&self) -> &VertexId<Self::Key>;
fn weight(&self) -> &Weight<T>;
fn weight_mut(&mut self) -> &mut Weight<T>;
// Provided methods
fn replace_weight(&mut self, weight: Weight<T>) -> Weight<T> { ... }
fn set_weight(&mut self, weight: T) -> &mut Self { ... }
fn swap_weight(&mut self, weight: &mut Weight<T>) { ... }
fn take_weight(&mut self) -> Weight<T>
where T: Default { ... }
}
Expand description
Required Methods§
Sourcefn weight_mut(&mut self) -> &mut Weight<T>
fn weight_mut(&mut self) -> &mut Weight<T>
returns a mutable reference to the node data
Provided Methods§
Sourcefn replace_weight(&mut self, weight: Weight<T>) -> Weight<T>
fn replace_weight(&mut self, weight: Weight<T>) -> Weight<T>
replace
the weight of the node with a new one, returning the
previous value
Sourcefn set_weight(&mut self, weight: T) -> &mut Self
fn set_weight(&mut self, weight: T) -> &mut Self
overwrites the weight of the node with a new one and returns a mutable reference to the edge.
Sourcefn swap_weight(&mut self, weight: &mut Weight<T>)
fn swap_weight(&mut self, weight: &mut Weight<T>)
swap
the weight of the node with another weight
Sourcefn take_weight(&mut self) -> Weight<T>where
T: Default,
fn take_weight(&mut self) -> Weight<T>where
T: Default,
take
the weight of the node, replacing it with a default value
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.