SeekBySize

Struct SeekBySize 

Source
pub struct SeekBySize<Spec> {
    index: usize,
    _marker: PhantomData<fn() -> Spec>,
}

Fields§

§index: usize§_marker: PhantomData<fn() -> Spec>

Implementations§

Source§

impl<Spec> SeekBySize<Spec>

Source

pub fn new(index: usize) -> Self

Examples found in repository?
crates/competitive/src/data_structure/binary_search_tree/split.rs (line 168)
162    pub fn seek_by_size<R>(node: &'a mut Option<BstRoot<Spec>>, range: R) -> Self
163    where
164        Spec: BstSpec<Data: BstDataAccess<data::marker::Size, Value = usize>>,
165        R: RangeBounds<usize>,
166    {
167        let start = match range.start_bound() {
168            Bound::Included(&index) => Bound::Included(SeekBySize::new(index)),
169            Bound::Excluded(&index) => Bound::Excluded(SeekBySize::new(index)),
170            Bound::Unbounded => Bound::Unbounded,
171        };
172        let end = match range.end_bound() {
173            Bound::Included(&index) => Bound::Included(SeekBySize::new(index)),
174            Bound::Excluded(&index) => Bound::Excluded(SeekBySize::new(index)),
175            Bound::Unbounded => Bound::Unbounded,
176        };
177        Self::new(node, start, end)
178    }

Trait Implementations§

Source§

impl<Spec> BstSeeker for SeekBySize<Spec>
where Spec: BstSpec<Data: BstDataAccess<Size, Value = usize>>,

Source§

type Spec = Spec

Source§

fn bst_seek(&mut self, node: BstImmutRef<'_, Self::Spec>) -> Ordering

Auto Trait Implementations§

§

impl<Spec> Freeze for SeekBySize<Spec>

§

impl<Spec> RefUnwindSafe for SeekBySize<Spec>

§

impl<Spec> Send for SeekBySize<Spec>

§

impl<Spec> Sync for SeekBySize<Spec>

§

impl<Spec> Unpin for SeekBySize<Spec>

§

impl<Spec> UnwindSafe for SeekBySize<Spec>

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.