Struct tea_core::prelude::OptIter

source ·
pub struct OptIter<'a, V: Vec1View<T>, T> {
    pub view: &'a V,
    pub item: PhantomData<T>,
}

Fields§

§view: &'a V§item: PhantomData<T>

Trait Implementations§

source§

impl<V: Vec1View<T>, T> GetLen for OptIter<'_, V, T>

source§

fn len(&self) -> usize

source§

fn is_empty(&self) -> bool

source§

impl<'a, 'b, V: Vec1View<T>, T: IsNone> IntoIterator for &'b OptIter<'a, V, T>

§

type Item = Option<<T as IsNone>::Inner>

The type of the elements being iterated over.
§

type IntoIter = Box<dyn TrustedLen<Item = Option<<T as IsNone>::Inner>> + 'b>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, V: Vec1View<T>, T: IsNone + 'a> Slice<Option<<T as IsNone>::Inner>> for OptIter<'a, V, T>
where V::Output<'a>: TIter<T>,

§

type Output<'b> = Vec<Option<<T as IsNone>::Inner>> where Self: 'b, Option<T::Inner>: 'b

source§

fn slice<'b>( &'b self, start: usize, end: usize, ) -> TResult<Cow<'a, Self::Output<'b>>>
where Option<T::Inner>: 'b,

source§

impl<V: Vec1View<T>, T: IsNone> TIter<Option<<T as IsNone>::Inner>> for OptIter<'_, V, T>

source§

fn titer<'a>( &'a self, ) -> TrustIter<impl TIterator<Item = Option<<T as IsNone>::Inner>>>
where Self: 'a,

source§

fn map<'a, U, F>(&'a self, f: F) -> TrustIter<impl TIterator<Item = U>>
where F: FnMut(T) -> U, T: 'a,

source§

impl<'a, T: IsNone + 'a, V: Vec1View<T>> Vec1View<Option<<T as IsNone>::Inner>> for OptIter<'a, V, T>
where for<'b> V::Output<'b>: TIter<T>,

source§

unsafe fn uget(&self, index: usize) -> Option<T::Inner>

Get the value at the index Read more
source§

fn try_as_slice(&self) -> Option<&[T]>

source§

fn iter_cast<'a, U>(&'a self) -> TrustIter<impl TIterator<Item = U>>
where T: 'a + Cast<U>,

source§

fn opt_iter_cast<'a, U>(&'a self) -> TrustIter<impl TIterator<Item = Option<U>>>
where T: IsNone + 'a, <T as IsNone>::Inner: Cast<U>,

source§

fn opt(&self) -> OptIter<'_, Self, T>
where T: IsNone, Self: Sized,

source§

fn to_opt_iter<'a>( &'a self, ) -> TrustIter<impl TIterator<Item = Option<T::Inner>>>
where T: IsNone + 'a,

source§

unsafe fn uvget(&self, index: usize) -> Option<T::Inner>
where T: IsNone,

if the value is valid, return it, otherwise return None Read more
source§

fn get(&self, index: usize) -> TResult<T>

source§

fn vget(&self, index: usize) -> Option<T::Inner>
where T: IsNone,

source§

fn rolling_custom_iter<U, F>( &self, window: usize, f: F, ) -> impl TrustedLen<Item = U>
where F: FnMut(Cow<'_, <Self as Slice<T>>::Output<'_>>) -> U,

Rolling and apply a custom funtion to each window, but it won’t collect result
source§

fn rolling_custom<O: Vec1<OT>, OT: Clone, F>( &self, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where F: FnMut(Cow<'_, <Self as Slice<T>>::Output<'_>>) -> OT,

Rolling and apply a custom funtion to each window
source§

fn rolling2_custom<O: Vec1<OT>, OT: Clone, V2, T2, F>( &self, other: &V2, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where V2: Vec1View<T2>, F: FnMut(&<Self as Slice<T>>::Output<'_>, &<V2 as Slice<T2>>::Output<'_>) -> OT,

Rolling and apply a custom funtion to each window of two vecs
source§

fn rolling_apply<O: Vec1<OT>, OT, F>( &self, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T: Clone, F: FnMut(Option<T>, T) -> OT,

Rolling and apply a function, the function accept whether to move element from the window and a value to be added to the window
source§

fn rolling_apply_to<O: Vec1<OT>, OT, F>( &self, window: usize, f: F, out: O::UninitRefMut<'_>, )
where T: Clone, F: FnMut(Option<T>, T) -> OT,

Rolling and apply a function, the function accept whether to move element from the window and a value to be added to the window. Read more
source§

fn rolling2_apply<O: Vec1<OT>, OT, V2: Vec1View<T2>, T2, F>( &self, other: &V2, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T: Clone, T2: Clone, F: FnMut(Option<(T, T2)>, (T, T2)) -> OT,

Rolling and apply a function to both vecs, the function accept whether to move element from the window and a value to be added to the window
source§

fn rolling2_apply_to<O: Vec1<OT>, OT, V2: Vec1View<T2>, T2, F>( &self, other: &V2, window: usize, f: F, out: O::UninitRefMut<'_>, )
where F: FnMut(Option<(T, T2)>, (T, T2)) -> OT,

Rolling and apply a function to both vecs, the function accept whether to move element from the window and a value to be added to the window. Read more
source§

fn rolling_apply_idx<O: Vec1<OT>, OT, F>( &self, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where F: FnMut(Option<usize>, usize, T) -> OT,

source§

fn rolling_apply_idx_to<O: Vec1<OT>, OT, F>( &self, window: usize, f: F, out: O::UninitRefMut<'_>, )
where F: FnMut(Option<usize>, usize, T) -> OT,

be careful to use this function as it will panic in polars backend. use rolling_apply_idx instead
source§

fn rolling2_apply_idx<O: Vec1<OT>, OT, V2: Vec1View<T2>, T2, F>( &self, other: &V2, window: usize, f: F, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where F: FnMut(Option<usize>, usize, (T, T2)) -> OT,

source§

fn rolling2_apply_idx_to<O: Vec1<OT>, OT, V2: Vec1View<T2>, T2, F>( &self, other: &V2, window: usize, f: F, out: O::UninitRefMut<'_>, )
where F: FnMut(Option<usize>, usize, (T, T2)) -> OT,

be careful to use this function as it will panic in polars backend. use rolling2_apply_idx instead

Auto Trait Implementations§

§

impl<'a, V, T> Freeze for OptIter<'a, V, T>

§

impl<'a, V, T> RefUnwindSafe for OptIter<'a, V, T>

§

impl<'a, V, T> Send for OptIter<'a, V, T>
where V: Sync, T: Send,

§

impl<'a, V, T> Sync for OptIter<'a, V, T>
where V: Sync, T: Sync,

§

impl<'a, V, T> Unpin for OptIter<'a, V, T>
where T: Unpin,

§

impl<'a, V, T> UnwindSafe for OptIter<'a, V, 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> Cast<T> for T

source§

fn cast(self) -> T

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>,

§

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>,

§

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.