pub trait Annotation: Debug + Copy {
// Required methods
fn merge_scc(self, other: Self) -> Self;
fn merge_reached(self, other: Self) -> Self;
// Provided methods
fn update_scc(&mut self, other: Self) { ... }
fn update_reachable(&mut self, other: Self) { ... }
}
Expand description
An annotation for an SCC. This can be a representative, the max/min element of the SCC, or all of the above.
Concretely, the both merge operations must commute, e.g. where merge
is merge_scc
and merge_reached
: a.merge(b) == b.merge(a)
In general, what you want is probably always min/max according to some ordering, potentially with side constraints (min x such that P holds).
Required Methods§
sourcefn merge_scc(self, other: Self) -> Self
fn merge_scc(self, other: Self) -> Self
Merge two existing annotations into one during path compression.o
sourcefn merge_reached(self, other: Self) -> Self
fn merge_reached(self, other: Self) -> Self
Merge a successor into this annotation.
Provided Methods§
fn update_scc(&mut self, other: Self)
fn update_reachable(&mut self, other: 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.
Implementations on Foreign Types§
source§impl Annotation for ()
impl Annotation for ()
The empty annotation, which does nothing.