Skip to main content

TakeExact

Struct TakeExact 

Source
pub struct TakeExact<Inner> { /* private fields */ }
Expand description

This struct is created by the take_exact() method on ExactParallelSourceExt.

You most likely won’t need to interact with this struct directly, as it implements the ExactParallelSource and ExactParallelSourceExt traits, but it is nonetheless public because of the must_use annotation.

Trait Implementations§

Source§

impl<Inner: ExactParallelSource> ExactParallelSource for TakeExact<Inner>

Source§

type Item = <Inner as ExactParallelSource>::Item

The type of items that this parallel source produces. Read more
Source§

fn exact_descriptor( self, ) -> impl ExactSourceDescriptor<Item = Self::Item> + Sync

Returns an object that describes how to fetch items from this source.
Source§

impl<Inner> RewindableSource for TakeExact<Inner>
where Inner: RewindableSource,

Auto Trait Implementations§

§

impl<Inner> Forget for TakeExact<Inner>

§

impl<Inner> Freeze for TakeExact<Inner>
where Inner: Freeze,

§

impl<Inner> Move for TakeExact<Inner>

§

impl<Inner> RefUnwindSafe for TakeExact<Inner>
where Inner: RefUnwindSafe,

§

impl<Inner> Send for TakeExact<Inner>
where Inner: Send,

§

impl<Inner> Sync for TakeExact<Inner>
where Inner: Sync,

§

impl<Inner> Unpin for TakeExact<Inner>
where Inner: Unpin,

§

impl<Inner> UnsafeUnpin for TakeExact<Inner>
where Inner: UnsafeUnpin,

§

impl<Inner> UnwindSafe for TakeExact<Inner>
where Inner: UnwindSafe,

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> ExactParallelSourceExt for T

Source§

fn array_windows<const N: usize>(self) -> ArrayWindows<Self, N>
where Self: RewindableSource,

Returns a parallel source that produces overlapping arrays of N contiguous items from this source. Read more
Source§

fn chain<T: ExactParallelSource<Item = Self::Item>>( self, next: T, ) -> Chain<Self, T>

Returns a parallel source that produces items from this source followed by items from the next source. Read more
Source§

fn cloned<'a, T>(self) -> Cloned<Self>
where Self: ExactParallelSource<Item = &'a T>, T: Clone + 'a,

Returns a parallel source that produces items that are cloned from the items of this source. This is useful if you have a source over &T and want a source over T, when T is Clone. Read more
Source§

fn copied<'a, T>(self) -> Copied<Self>
where Self: ExactParallelSource<Item = &'a T>, T: Copy + 'a,

Returns a parallel source that produces items that are copied from the items of this source. This is useful if you have a source over &T and want a source over T, when T is Copy. Read more
Source§

fn cycle(self, n: usize) -> Cycle<Self>
where Self: RewindableSource,

Returns a parallel source that produces items from this source the given number of times. Read more
Source§

fn downgrade(self) -> Downgrade<Self>

Transforms this ExactParallelSource into an equivalent ParallelSource. Read more
Source§

fn enumerate(self) -> Enumerate<Self>

Returns a parallel source that produces pairs of (index, item) for the items of this source. Read more
Source§

fn filter<F>(self, f: F) -> FilterExact<Self, F>
where F: Fn(&Self::Item) -> bool + Sync,

Returns a parallel source that produces only the items for which the predicate f returns true. Read more
Source§

fn filter_map<T, F>(self, f: F) -> FilterMapExact<Self, F>
where F: Fn(Self::Item) -> Option<T> + Sync,

Applies the function f to each item of this source, returning a parallel source that produces the mapped items x for which f returns Some(x) and skips the items for which f returns None. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: Fn(&Self::Item) + Sync,

Runs the function f on each item of this source in a pass-through manner, returning a parallel source producing the original items. Read more
Source§

fn map<T, F>(self, f: F) -> MapSource<Self, F>
where F: Fn(Self::Item) -> T + Sync,

Applies the function f to each item of this source, returning a parallel source producing the mapped items. Read more
Source§

fn map_init<I, Init, T, F>(self, init: Init, f: F) -> MapInit<Self, Init, F>
where Init: Fn() -> I + Sync, F: Fn(&mut I, Self::Item) -> T + Sync,

Applies the function f to each item of this source, together with a per-thread mutable value returned by init, and returns a parallel source producing the mapped items. Read more
Source§

fn rev(self) -> Rev<Self>

Returns a parallel source that produces items from this source in reverse order. Read more
Source§

fn skip(self, n: usize) -> Skip<Self>

Returns a parallel source that skips the first n items from this source, or all the items if this source has fewer than n items, and produces the remaining items. Read more
Source§

fn skip_exact(self, n: usize) -> SkipExact<Self>

Returns a parallel source that skips the first n items from this source, panicking if this source has fewer than n items, and produces the remaining items. Read more
Source§

fn step_by(self, n: usize) -> StepBy<Self>

Returns a parallel source that produces every n-th item from this source, starting with the first one. Read more
Source§

fn take(self, n: usize) -> Take<Self>

Returns a parallel source that produces the first n items from this source, or all the items if this source has fewer than n items. Read more
Source§

fn take_exact(self, n: usize) -> TakeExact<Self>

Returns a parallel source that produces the first n items from this source, panicking if this source has fewer than n items. Read more
Source§

fn update<F>(self, f: F) -> Update<Self, F>
where F: Fn(&mut Self::Item) + Sync,

Applies the function f to each item of this source, returning a parallel source producing the updated items. Read more
Source§

fn with_thread_pool<T: GenericThreadPool>( self, thread_pool: T, ) -> BaseExactParallelIterator<T, Self>

Attaches the given GenericThreadPool to this ExactParallelSource and obtain a ParallelIterator. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.