Struct segment_tree::ops::WithIdentity
[−]
[src]
pub struct WithIdentity<A> { /* fields omitted */ }
Adds an identity to an operation by wrapping the type in Option
. Clones when combined with
None.
Trait Implementations
impl<TA: Clone, A: Operation<TA>> Operation<Option<TA>> for WithIdentity<A>
[src]
fn combine(a: &Option<TA>, b: &Option<TA>) -> Option<TA>
The operation that is performed to combine two intervals in the segment tree. Read more
fn combine_mut(a: &mut Option<TA>, b: &Option<TA>)
Replace the value in a with combine(a, b)
. This function exists to allow certain optimizations and by default simply calls combine
. Read more
fn combine_mut2(a: &Option<TA>, b: &mut Option<TA>)
Replace the value in a with combine(a, b)
. This function exists to allow certain optimizations and by default simply calls combine
. Read more
fn combine_left(a: Option<TA>, b: &Option<TA>) -> Option<TA>
Must return the same as combine
. This function exists to allow certain optimizations and by default simply calls combine_mut
. Read more
fn combine_right(a: &Option<TA>, b: Option<TA>) -> Option<TA>
Must return the same as combine
. This function exists to allow certain optimizations and by default simply calls combine_mut2
. Read more
fn combine_both(a: Option<TA>, b: Option<TA>) -> Option<TA>
Must return the same as combine
. This function exists to allow certain optimizations and by default simply calls combine_left
. Read more