Struct segment_tree::ops::Pair
source · pub struct Pair<A, B> { /* private fields */ }
Expand description
Store several pieces of information in each node.
Implementations§
Trait Implementations§
source§impl<TA, TB, A: Invertible<TA>, B: Invertible<TB>> Invertible<(TA, TB)> for Pair<A, B>
impl<TA, TB, A: Invertible<TA>, B: Invertible<TB>> Invertible<(TA, TB)> for Pair<A, B>
source§impl<TA, TB, A: Operation<TA>, B: Operation<TB>> Operation<(TA, TB)> for Pair<A, B>
impl<TA, TB, A: Operation<TA>, B: Operation<TB>> Operation<(TA, TB)> for Pair<A, B>
source§fn combine(&self, a: &(TA, TB), b: &(TA, TB)) -> (TA, TB)
fn combine(&self, a: &(TA, TB), b: &(TA, TB)) -> (TA, TB)
The operation that is performed to combine two intervals in the segment tree. Read more
source§fn combine_mut(&self, a: &mut (TA, TB), b: &(TA, TB))
fn combine_mut(&self, a: &mut (TA, TB), b: &(TA, TB))
Replace the value in
a
with combine(a, b)
. This function exists to allow
certain optimizations and by default simply calls combine
. Read moresource§fn combine_mut2(&self, a: &(TA, TB), b: &mut (TA, TB))
fn combine_mut2(&self, a: &(TA, TB), b: &mut (TA, TB))
Replace the value in
b
with combine(a, b)
. This function exists to allow
certain optimizations and by default simply calls combine
. Read moresource§fn combine_left(&self, a: (TA, TB), b: &(TA, TB)) -> (TA, TB)
fn combine_left(&self, a: (TA, TB), b: &(TA, TB)) -> (TA, TB)
Must return the same as
combine
. This function exists to allow certain
optimizations and by default simply calls combine_mut
. Read moresource§impl<A: Ord, B: Ord> Ord for Pair<A, B>
impl<A: Ord, B: Ord> Ord for Pair<A, B>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<A: PartialEq, B: PartialEq> PartialEq<Pair<A, B>> for Pair<A, B>
impl<A: PartialEq, B: PartialEq> PartialEq<Pair<A, B>> for Pair<A, B>
source§impl<A: PartialOrd, B: PartialOrd> PartialOrd<Pair<A, B>> for Pair<A, B>
impl<A: PartialOrd, B: PartialOrd> PartialOrd<Pair<A, B>> for Pair<A, B>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more