pub struct TakeWhile<Prev, Func> { /* private fields */ }Expand description
Pull combinator that yields items while a predicate returns true.
Trait Implementations§
Source§impl<Prev, Func> Pull for TakeWhile<Prev, Func>
impl<Prev, Func> Pull for TakeWhile<Prev, Func>
Source§type CanEnd = Yes
type CanEnd = Yes
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>
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>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the pull. Read more
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
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>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
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>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
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>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, F, U::IntoIter, Self::Meta>
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>
fn flatten( self, ) -> Flatten<Self, <Self::Item as IntoIterator>::IntoIter, Self::Meta>
Creates a pull that flattens nested structure. Read more
Source§fn flatten_stream(self) -> FlattenStream<Self, Self::Item, Self::Meta>
fn flatten_stream(self) -> FlattenStream<Self, Self::Item, Self::Meta>
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> ⓘ
fn for_each<F>(self, f: F) -> ForEach<Self, F> ⓘ
Creates a future which runs the given function on each element of a pull.
Source§fn collect<C>(self) -> Collect<Self, C> ⓘ
fn collect<C>(self) -> Collect<Self, C> ⓘ
Creates a future which collects all elements of a pull into a collection. 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,
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 moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
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>
fn map<B, F>(self, f: F) -> Map<Self, F>
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> ⓘ
fn send_sink<Push>(self, push: Push) -> SendSink<Self, Push> ⓘ
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> ⓘ
fn send_push<Psh>(self, push: Psh) -> SendPush<Self, Psh> ⓘ
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,
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>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
Creates a pull that skips elements based on a predicate. Read more
Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
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>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Creates a pull that yields elements based on a predicate. Read more
Source§fn zip<U>(self, other: U) -> Zip<Self, U>
fn zip<U>(self, other: U) -> Zip<Self, U>
Zips two pulls together, stopping once either is exhausted.
Source§fn next(self) -> Next<Self> ⓘwhere
Self: Sized,
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>>
fn cross_singleton<SinglePull>( self, singleton_pull: SinglePull, ) -> CrossSingleton<Self, SinglePull, Option<SinglePull::Item>>
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>>
fn cross_singleton_state<SinglePull>( self, singleton_pull: SinglePull, singleton_state: &mut Option<SinglePull::Item>, ) -> CrossSingleton<Self, SinglePull, &mut Option<SinglePull::Item>>
Self::cross_singleton with external state.
impl<'__pin, Prev, Func> Unpin for TakeWhile<Prev, Func>where
PinnedFieldsOf<__Origin<'__pin, Prev, Func>>: Unpin,
Auto Trait Implementations§
impl<Prev, Func> Freeze for TakeWhile<Prev, Func>
impl<Prev, Func> RefUnwindSafe for TakeWhile<Prev, Func>where
Prev: RefUnwindSafe,
Func: RefUnwindSafe,
impl<Prev, Func> Send for TakeWhile<Prev, Func>
impl<Prev, Func> Sync for TakeWhile<Prev, Func>
impl<Prev, Func> UnsafeUnpin for TakeWhile<Prev, Func>where
Prev: UnsafeUnpin,
Func: UnsafeUnpin,
impl<Prev, Func> UnwindSafe for TakeWhile<Prev, Func>where
Prev: UnwindSafe,
Func: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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