pub struct Map<CS, F, FutT, T, FutB, B>
where CS: ConcurrentStream<Item = T, Future = FutT>, F: Fn(T) -> FutB + Clone, FutT: Future<Output = T>, FutB: Future<Output = B>,
{ /* private fields */ }
Expand description

Convert items from one type into another

Trait Implementations§

source§

impl<CS, F, FutT, T, FutB, B> ConcurrentStream for Map<CS, F, FutT, T, FutB, B>
where CS: ConcurrentStream<Item = T, Future = FutT>, F: Fn(T) -> FutB + Clone, FutT: Future<Output = T>, FutB: Future<Output = B>,

source§

type Future = MapFuture<F, FutT, T, FutB, B>

What’s the type of the future containing our items?
source§

type Item = B

Which item will we be yielding?
source§

async fn drive<C>(self, consumer: C) -> C::Output
where C: Consumer<Self::Item, Self::Future>,

Internal method used to define the behavior of this concurrent iterator. You should not need to call this directly. This method causes the iterator self to start producing items and to feed them to the consumer consumer one by one.
source§

fn concurrency_limit(&self) -> Option<NonZeroUsize>

How much concurrency should we apply?
source§

fn size_hint(&self) -> (usize, Option<usize>)

How many items could we potentially end up returning?
source§

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Creates a stream which gives the current iteration count as well as the next value. Read more
source§

fn limit(self, limit: Option<NonZeroUsize>) -> Limit<Self>
where Self: Sized,

Obtain a simple pass-through adapter.
source§

fn take(self, limit: usize) -> Take<Self>
where Self: Sized,

Creates a stream that yields the first n elements, or fewer if the underlying iterator ends sooner.
source§

fn map<F, FutB, B>( self, f: F, ) -> Map<Self, F, Self::Future, Self::Item, FutB, B>
where Self: Sized, F: Fn(Self::Item) -> FutB + Clone, FutB: Future<Output = B>,

Convert items from one type into another
source§

async fn for_each<F, Fut>(self, f: F)
where Self: Sized, F: Fn(Self::Item) -> Fut + Clone, Fut: Future<Output = ()>,

Iterate over each item concurrently
source§

async fn try_for_each<F, Fut, E>(self, f: F) -> Result<(), E>
where Self: Sized, F: Fn(Self::Item) -> Fut + Clone, Fut: Future<Output = Result<(), E>>,

Iterate over each item concurrently, short-circuit on error. Read more
source§

async fn collect<B>(self) -> B
where B: FromConcurrentStream<Self::Item>, Self: Sized,

Transforms an iterator into a collection.
source§

impl<CS, F, FutT, T: Debug, FutB, B: Debug> Debug for Map<CS, F, FutT, T, FutB, B>
where CS: ConcurrentStream<Item = T, Future = FutT> + Debug, F: Fn(T) -> FutB + Clone + Debug, FutT: Future<Output = T> + Debug, FutB: Future<Output = B> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<CS, F, FutT, T, FutB, B> Freeze for Map<CS, F, FutT, T, FutB, B>
where CS: Freeze, F: Freeze,

§

impl<CS, F, FutT, T, FutB, B> RefUnwindSafe for Map<CS, F, FutT, T, FutB, B>

§

impl<CS, F, FutT, T, FutB, B> Send for Map<CS, F, FutT, T, FutB, B>
where CS: Send, F: Send, FutT: Send, T: Send, FutB: Send, B: Send,

§

impl<CS, F, FutT, T, FutB, B> Sync for Map<CS, F, FutT, T, FutB, B>
where CS: Sync, F: Sync, FutT: Sync, T: Sync, FutB: Sync, B: Sync,

§

impl<CS, F, FutT, T, FutB, B> Unpin for Map<CS, F, FutT, T, FutB, B>
where CS: Unpin, F: Unpin, FutT: Unpin, T: Unpin, FutB: Unpin, B: Unpin,

§

impl<CS, F, FutT, T, FutB, B> UnwindSafe for Map<CS, F, FutT, T, FutB, B>
where CS: UnwindSafe, F: UnwindSafe, FutT: UnwindSafe, T: UnwindSafe, FutB: UnwindSafe, B: 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> 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<S> IntoConcurrentStream for S

source§

type Item = <S as ConcurrentStream>::Item

The type of the elements being iterated over.
source§

type IntoConcurrentStream = S

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

fn into_co_stream(self) -> <S as IntoConcurrentStream>::IntoConcurrentStream

Convert self into a concurrent iterator.
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.