SeekByRaccCond

Struct SeekByRaccCond 

Source
struct SeekByRaccCond<F, T>
where T: LazyMapMonoid,
{ acc: T::Agg, f: F, _marker: PhantomData<fn() -> T>, }

Fields§

§acc: T::Agg§f: F§_marker: PhantomData<fn() -> T>

Implementations§

Source§

impl<F, T> SeekByRaccCond<F, T>
where T: LazyMapMonoid,

Source

fn new(f: F) -> Self

Examples found in repository?
crates/competitive/src/data_structure/splay_tree/sequence.rs (line 413)
407    pub fn rposition_acc<R, F>(&mut self, range: R, f: F) -> Option<usize>
408    where
409        R: RangeBounds<usize>,
410        F: FnMut(&T::Agg) -> bool,
411    {
412        let mut range = self.range(range);
413        let ord = range.root_mut().splay_by(SeekByRaccCond::new(f));
414        if !matches!(ord, Some(Ordering::Equal)) {
415            return None;
416        }
417        let front_size = range.front().size();
418        let left_size = range.root().left_size();
419        Some(front_size + left_size)
420    }

Trait Implementations§

Source§

impl<F, T> SplaySeeker for SeekByRaccCond<F, T>
where F: FnMut(&T::Agg) -> bool, T: LazyMapMonoid,

Source§

type S = LazyAggSplay<T>

Source§

fn splay_seek(&mut self, node: NodeRef<Immut<'_>, Self::S>) -> Ordering

Auto Trait Implementations§

§

impl<F, T> Freeze for SeekByRaccCond<F, T>
where <T as LazyMapMonoid>::Agg: Freeze, F: Freeze,

§

impl<F, T> RefUnwindSafe for SeekByRaccCond<F, T>

§

impl<F, T> Send for SeekByRaccCond<F, T>
where <T as LazyMapMonoid>::Agg: Send, F: Send,

§

impl<F, T> Sync for SeekByRaccCond<F, T>
where <T as LazyMapMonoid>::Agg: Sync, F: Sync,

§

impl<F, T> Unpin for SeekByRaccCond<F, T>
where <T as LazyMapMonoid>::Agg: Unpin, F: Unpin,

§

impl<F, T> UnwindSafe for SeekByRaccCond<F, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.