pub trait Annotation: Debug + Copy {
// Required 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 update_scc and update_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 update_scc(&mut self, other: &Self)
fn update_scc(&mut self, other: &Self)
Merge two existing annotations into one during path compression.
Sourcefn update_reachable(&mut self, other: &Self)
fn update_reachable(&mut self, other: &Self)
Merge a successor into this annotation.
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 ()
The empty annotation, which does nothing.
impl Annotation for ()
The empty annotation, which does nothing.