pub trait WavlTreeAugmentedInvariantObserverTraits {
type Target;
type Value: Copy;
// Required methods
fn get_node_value(node: &Self::Target) -> Self::Value;
fn get_subtree_value(node: &Self::Target) -> Self::Value;
fn combine_values(a: Self::Value, b: Self::Value) -> Self::Value;
fn set_subtree_value(node: &mut Self::Target, val: Self::Value);
fn reset_subtree_value(node: &mut Self::Target);
}Expand description
Traits to implement to use WavlTreeAugmentedInvariantObserver.
Required Associated Types§
Required Methods§
Sourcefn get_node_value(node: &Self::Target) -> Self::Value
fn get_node_value(node: &Self::Target) -> Self::Value
Returns the invariant value for the given node.
Sourcefn get_subtree_value(node: &Self::Target) -> Self::Value
fn get_subtree_value(node: &Self::Target) -> Self::Value
Returns the invariant value for the given node’s subtree.
Sourcefn combine_values(a: Self::Value, b: Self::Value) -> Self::Value
fn combine_values(a: Self::Value, b: Self::Value) -> Self::Value
Combines subtree and node invariant values to produce a new subtree invariant value.
Values are combined in in-order (left-to-right) sequence:
left_subtree_value is combined with node_value, and the result is combined
with right_subtree_value.
The operation must be associative: (a ∘ b) ∘ c == a ∘ (b ∘ c).
Non-commutative operations (such as string concatenation or sequence tracking)
are supported because child and node values are strictly combined in
in-order sequence across insertions, erasures, and rotations.
Sourcefn set_subtree_value(node: &mut Self::Target, val: Self::Value)
fn set_subtree_value(node: &mut Self::Target, val: Self::Value)
Sets the node’s subtree invariant value.
Sourcefn reset_subtree_value(node: &mut Self::Target)
fn reset_subtree_value(node: &mut Self::Target)
Resets the node’s subtree invariant value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".