Trait ConsoliableWeight

Source
pub trait ConsoliableWeight: Clone + Eq {
    // Required methods
    fn empty() -> Self;
    fn consolidate(a: &Self, b: &Self) -> Self;

    // Provided method
    fn accure(&mut self, other: &Self) { ... }
}
Expand description

The weight type in a Treap. It is used to perform operations like calculating sums or maximum values of an interval in logrithmic time over treap.

Required Methods§

Source

fn empty() -> Self

Create a default or ‘zero’ value for the weight. Consolidating with this value should not change the other value.

Source

fn consolidate(a: &Self, b: &Self) -> Self

Combine two weights into a single one.

Provided Methods§

Source

fn accure(&mut self, other: &Self)

Combine another weight into self. It allows for implementing more efficient in-place consolidation.

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.

Implementors§

Source§

impl ConsoliableWeight for NoWeight

Source§

impl<T: Add<Output = T> + Clone + Zero + Eq> ConsoliableWeight for T