pub trait Edge<K, W, C>{
// Required methods
fn get_weight(&self) -> W;
fn set_weight(&mut self, weight: W);
fn left(&self) -> &K;
fn right(&self) -> &K;
fn get_pair(&self) -> (&K, &K);
fn generate_key(pair: (&K, &K)) -> C;
fn key(&self) -> C;
}Expand description
Generic behaviour of an edge
Generic type C is the key type of the edge
Generic type K is the key type of the vertexes connected by the edge
Generic type W is
Required Methods§
fn get_weight(&self) -> W
fn set_weight(&mut self, weight: W)
fn left(&self) -> &K
fn right(&self) -> &K
Sourcefn get_pair(&self) -> (&K, &K)
fn get_pair(&self) -> (&K, &K)
This pair must not be used as a key for the edge, this must instead be used to generate the key or to construct a new edge
Sourcefn generate_key(pair: (&K, &K)) -> C
fn generate_key(pair: (&K, &K)) -> C
An associated function constructing the edge key from a pair of vertex keys must be implemented for the edge tipe
the key returned by the key(&self) method must correspond to the key generated by said function with the pair of keys returned by the method get_pair(&self)
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.