SeekByAccCond

Struct SeekByAccCond 

Source
struct SeekByAccCond<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> SeekByAccCond<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 399)
393    pub fn position_acc<R, F>(&mut self, range: R, f: F) -> Option<usize>
394    where
395        R: RangeBounds<usize>,
396        F: FnMut(&T::Agg) -> bool,
397    {
398        let mut range = self.range(range);
399        let ord = range.root_mut().splay_by(SeekByAccCond::new(f));
400        if !matches!(ord, Some(Ordering::Equal)) {
401            return None;
402        }
403        let front_size = range.front().size();
404        let left_size = range.root().left_size();
405        Some(front_size + left_size)
406    }

Trait Implementations§

Source§

impl<F, T> SplaySeeker for SeekByAccCond<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 SeekByAccCond<F, T>
where <T as LazyMapMonoid>::Agg: Freeze, F: Freeze,

§

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

§

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

§

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

§

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

§

impl<F, T> UnwindSafe for SeekByAccCond<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.