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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ConsoliableWeight for NoWeight

source§

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