Skip to main content

ZipLongest

Struct ZipLongest 

Source
pub struct ZipLongest<Prev1, Prev2>
where Prev1: Pull, Prev2: Pull,
{ /* private fields */ }
Expand description

A pull that zips two pulls together, continuing until both are exhausted.

Unlike a regular zip which ends when either pull ends, ZipLongest continues until both pulls have ended, yielding EitherOrBoth values.

Both upstream pulls must be fused (FusedPull) to ensure correct behavior after one pull ends.

Trait Implementations§

Source§

impl<Prev1, Prev2> Clone for ZipLongest<Prev1, Prev2>
where Prev1: Pull + Clone, Prev2: Pull + Clone, Prev1::Item: Clone, Prev1::Meta: Clone, Prev2::Item: Clone, Prev2::Meta: Clone,

Source§

fn clone(&self) -> ZipLongest<Prev1, Prev2>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Prev1, Prev2> Debug for ZipLongest<Prev1, Prev2>
where Prev1: Pull + Debug, Prev2: Pull + Debug, Prev1::Item: Debug, Prev1::Meta: Debug, Prev2::Item: Debug, Prev2::Meta: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Prev1, Prev2> Pull for ZipLongest<Prev1, Prev2>
where Prev1: FusedPull, Prev2: FusedPull<Meta = Prev1::Meta>,

Source§

type Ctx<'ctx> = <<Prev1 as Pull>::Ctx<'ctx> as Context<'ctx>>::Merged<<Prev2 as Pull>::Ctx<'ctx>>

The context type required to poll this pull.
Source§

type Item = EitherOrBoth<<Prev1 as Pull>::Item, <Prev2 as Pull>::Item>

The type of items yielded by this pull.
Source§

type Meta = <Prev1 as Pull>::Meta

The metadata type associated with each item.
Source§

type CanPend = <<Prev1 as Pull>::CanPend as Toggle>::Or<<Prev2 as Pull>::CanPend>

Whether this pull can return PullStep::Pending.
Source§

type CanEnd = <<Prev1 as Pull>::CanEnd as Toggle>::And<<Prev2 as Pull>::CanEnd>

Whether this pull can return PullStep::Ended.
Source§

fn pull( self: Pin<&mut Self>, ctx: &mut Self::Ctx<'_>, ) -> PullStep<Self::Item, Self::Meta, Self::CanPend, Self::CanEnd>

Attempts to pull the next item from this stream.
Source§

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

Returns the bounds on the remaining length of the pull. Read more
Source§

fn fuse( self, ) -> impl for<'ctx> FusedPull<Ctx<'ctx> = Self::Ctx<'ctx>, Item = Self::Item, Meta = Self::Meta, CanPend = Self::CanPend, CanEnd = Self::CanEnd>
where Self: Sized,

Creates a pull that ends after the first None. Read more
Source§

fn by_ref(&mut self) -> &mut Self

Borrows this pull, allowing it to be used by reference.
Source§

fn chain<U>(self, other: U) -> Chain<Self, U>
where Self: Sized + FusedPull<CanEnd = Yes>, U: Pull<Item = Self::Item, Meta = Self::Meta>,

Takes two pulls and creates a new pull over both in sequence. Read more
Source§

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

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

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where Self: Sized, P: FnMut(&Self::Item) -> bool,

Creates a pull which uses a closure to determine if an element should be yielded. Read more
Source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where Self: Sized, F: FnMut(Self::Item) -> Option<B>,

Creates a pull that both filters and maps. Read more
Source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, F, U::IntoIter, Self::Meta>
where Self: Sized, F: FnMut(Self::Item) -> U, U: IntoIterator,

Creates a pull that works like map, but flattens nested structure. Read more
Source§

fn flatten( self, ) -> Flatten<Self, <Self::Item as IntoIterator>::IntoIter, Self::Meta>
where Self: Sized, Self::Item: IntoIterator,

Creates a pull that flattens nested structure. Read more
Source§

fn flatten_stream(self) -> FlattenStream<Self, Self::Item, Self::Meta>
where Self: Sized, Self::Item: Stream,

Creates a pull that flattens items that are streams by polling each inner stream. Read more
Source§

fn for_each<F>(self, f: F) -> ForEach<Self, F>
where Self: Sized, F: FnMut(Self::Item),

Creates a future which runs the given function on each element of a pull.
Source§

fn collect<C>(self) -> Collect<Self, C>
where Self: Sized, C: Default + Extend<Self::Item>,

Creates a future which collects all elements of a pull into a collection. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where Self: Sized, F: FnMut(&Self::Item),

Does something with each element of a pull, passing the value on. Read more
Source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where Self: Sized, F: FnMut(Self::Item) -> B,

Takes a closure and creates a pull that calls that closure on each element. Read more
Source§

fn send_sink<Push>(self, push: Push) -> SendSink<Self, Push>
where Self: Sized, Push: Sink<Self::Item>,

Creates a future that pulls all items and sends them into a crate::Sink.
Source§

fn send_push<Psh>(self, push: Psh) -> SendPush<Self, Psh>
where Self: Sized, Psh: Push<Self::Item, Self::Meta>,

Creates a future that pulls all items and pushes them into a crate::push::Push.
Source§

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

Creates a pull that skips the first n elements.
Source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where Self: Sized, P: FnMut(&Self::Item) -> bool,

Creates a pull that skips elements based on a predicate. Read more
Source§

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

Creates a pull that yields the first n elements, or fewer if the underlying pull ends sooner.
Source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where Self: Sized, P: FnMut(&Self::Item) -> bool,

Creates a pull that yields elements based on a predicate. Read more
Source§

fn zip<U>(self, other: U) -> Zip<Self, U>
where Self: Sized, U: Pull<Meta = Self::Meta>,

Zips two pulls together, stopping once either is exhausted.
Source§

fn zip_longest<U>(self, other: U) -> ZipLongest<Self, U>
where Self: Sized + FusedPull, U: FusedPull<Meta = Self::Meta>,

Zips two pulls together, continuing until both are exhausted. Read more
Source§

fn next(self) -> Next<Self>
where Self: Sized,

Creates a future that resolves with the next item from this pull. Read more
Source§

fn cross_singleton<SinglePull>( self, singleton_pull: SinglePull, ) -> CrossSingleton<Self, SinglePull, Option<SinglePull::Item>>
where Self: Sized, SinglePull: Pull, SinglePull::Item: Clone,

Crosses each item from this pull with a singleton value from another pull. Read more
Source§

fn cross_singleton_state<SinglePull>( self, singleton_pull: SinglePull, singleton_state: &mut Option<SinglePull::Item>, ) -> CrossSingleton<Self, SinglePull, &mut Option<SinglePull::Item>>
where Self: Sized, SinglePull: Pull, SinglePull::Item: Clone,

Self::cross_singleton with external state.
Source§

fn symmetric_hash_join<Key, V1, Rhs, V2, LhsState, RhsState>( self, rhs: Rhs, lhs_state: LhsState, rhs_state: RhsState, ) -> SymmetricHashJoin<Self, Rhs, LhsState, RhsState, LhsState, RhsState>
where Self: Sized + FusedPull<Item = (Key, V1), Meta = ()>, Key: Eq + Hash + Clone, V1: Clone, V2: Clone, Rhs: FusedPull<Item = (Key, V2), Meta = ()>, LhsState: HalfJoinState<Key, V1, V2>, RhsState: HalfJoinState<Key, V2, V1>,

Available on crate feature std only.
Performs a symmetric hash join with another pull. Read more
Source§

fn symmetric_hash_join_state<'a, Key, V1, Rhs, V2, LhsState, RhsState>( self, rhs: Rhs, lhs_state: &'a mut LhsState, rhs_state: &'a mut RhsState, ) -> SymmetricHashJoin<Self, Rhs, &'a mut LhsState, &'a mut RhsState, LhsState, RhsState>
where Self: Sized + FusedPull<Item = (Key, V1), Meta = ()>, Key: Eq + Hash + Clone, V1: Clone, V2: Clone, Rhs: FusedPull<Item = (Key, V2), Meta = ()>, LhsState: HalfJoinState<Key, V1, V2>, RhsState: HalfJoinState<Key, V2, V1>,

Available on crate feature std only.
Self::symmetric_hash_join with external state.
Source§

impl<A, B> FusedPull for ZipLongest<A, B>
where A: FusedPull, B: FusedPull<Meta = A::Meta>,

Source§

impl<'__pin, Prev1, Prev2> Unpin for ZipLongest<Prev1, Prev2>
where PinnedFieldsOf<__Origin<'__pin, Prev1, Prev2>>: Unpin, Prev1: Pull, Prev2: Pull,

Auto Trait Implementations§

§

impl<Prev1, Prev2> Freeze for ZipLongest<Prev1, Prev2>
where Prev1: Freeze, Prev2: Freeze, <Prev1 as Pull>::Item: Freeze, <Prev1 as Pull>::Meta: Freeze, <Prev2 as Pull>::Item: Freeze, <Prev2 as Pull>::Meta: Freeze,

§

impl<Prev1, Prev2> RefUnwindSafe for ZipLongest<Prev1, Prev2>
where Prev1: RefUnwindSafe, Prev2: RefUnwindSafe, <Prev1 as Pull>::Item: RefUnwindSafe, <Prev1 as Pull>::Meta: RefUnwindSafe, <Prev2 as Pull>::Item: RefUnwindSafe, <Prev2 as Pull>::Meta: RefUnwindSafe,

§

impl<Prev1, Prev2> Send for ZipLongest<Prev1, Prev2>
where Prev1: Send, Prev2: Send, <Prev1 as Pull>::Item: Send, <Prev1 as Pull>::Meta: Send, <Prev2 as Pull>::Item: Send, <Prev2 as Pull>::Meta: Send,

§

impl<Prev1, Prev2> Sync for ZipLongest<Prev1, Prev2>
where Prev1: Sync, Prev2: Sync, <Prev1 as Pull>::Item: Sync, <Prev1 as Pull>::Meta: Sync, <Prev2 as Pull>::Item: Sync, <Prev2 as Pull>::Meta: Sync,

§

impl<Prev1, Prev2> UnsafeUnpin for ZipLongest<Prev1, Prev2>
where Prev1: UnsafeUnpin, Prev2: UnsafeUnpin, <Prev1 as Pull>::Item: UnsafeUnpin, <Prev1 as Pull>::Meta: UnsafeUnpin, <Prev2 as Pull>::Item: UnsafeUnpin, <Prev2 as Pull>::Meta: UnsafeUnpin,

§

impl<Prev1, Prev2> UnwindSafe for ZipLongest<Prev1, Prev2>
where Prev1: UnwindSafe, Prev2: UnwindSafe, <Prev1 as Pull>::Item: UnwindSafe, <Prev1 as Pull>::Meta: UnwindSafe, <Prev2 as Pull>::Item: UnwindSafe, <Prev2 as Pull>::Meta: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.