Skip to main content

Operation

Trait Operation 

Source
pub trait Operation<V, T>
where V: Clone + Copy, T: Clone + Copy,
{ const COMBINE: fn(left_val: V, right_val: V) -> V; const PUSH_VAL: fn(val: V, tag: T, len: usize) -> V; const PUSH_TAG: fn(child_tag: T, tag: T) -> T; const VAL_IDENTITY: V; const TAG_IDENTITY: T; }
Expand description

The abstract operation for segment tree.

Required Associated Constants§

Source

const COMBINE: fn(left_val: V, right_val: V) -> V

Combines two values from left and right child.

Source

const PUSH_VAL: fn(val: V, tag: T, len: usize) -> V

Pushes the tag down to the left or right child.

Source

const PUSH_TAG: fn(child_tag: T, tag: T) -> T

Pushes the tag down to the child tag.

Source

const VAL_IDENTITY: V

Identity value for the buffer.

Source

const TAG_IDENTITY: T

Identity value for the tag.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V> Operation<V, V> for AddSum

Source§

const COMBINE: fn(V, V) -> V

Source§

const PUSH_VAL: fn(V, V, usize) -> V

Source§

const PUSH_TAG: fn(V, V) -> V

Source§

const TAG_IDENTITY: V = V::ZERO

Source§

const VAL_IDENTITY: V = V::ZERO