Split

Struct Split 

Source
pub struct Split<'r, R: AsyncBufRead> { /* private fields */ }
Available on crate feature std only.
Expand description

Stream for AsyncBufReadExt::split.

The lifetime parameter of this type is an implementation detail, and it should be set to the lifetime of R. For example, if R is Empty is should be 'static and if R is Cursor<&'a [u8]> it should be 'a.

Trait Implementations§

Source§

impl<R: AsyncBufRead> CompletionStream for Split<'_, R>

Source§

type Item = Result<Vec<u8>, Error>

Values yielded by the stream.
Source§

unsafe fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

unsafe fn poll_cancel(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>

Attempt to cancel the stream, registering the current task for wakeup if it has not finished cancelling yet. Read more
Source§

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

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

impl<'r, R: AsyncBufRead> Stream for Split<'r, R>
where <R as AsyncBufReadWith<'r>>::FillBufFuture: Future<Output = Result<&'r [u8]>>,

Source§

type Item = Result<Vec<u8>, Error>

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

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

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

impl<'__pin, 'r, R: AsyncBufRead> Unpin for Split<'r, R>
where PinnedFieldsOf<__Origin<'__pin, 'r, R>>: Unpin,

Auto Trait Implementations§

§

impl<'r, R> Freeze for Split<'r, R>

§

impl<'r, R> RefUnwindSafe for Split<'r, R>

§

impl<'r, R> Send for Split<'r, R>
where R: Send, <R as AsyncBufReadWith<'r>>::FillBufFuture: Send,

§

impl<'r, R> Sync for Split<'r, R>
where R: Sync, <R as AsyncBufReadWith<'r>>::FillBufFuture: Sync,

§

impl<'r, R> !UnwindSafe for Split<'r, R>

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> CompletionStreamExt for T
where T: CompletionStream + ?Sized,

Source§

unsafe fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
where Self: Unpin,

A convenience for calling CompletionStream::poll_next on Unpin streams. Read more
Source§

unsafe fn poll_cancel(&mut self, cx: &mut Context<'_>) -> Poll<()>
where Self: Unpin,

A convenience for calling CompletionStream::poll_cancel on Unpin streams. Read more
Source§

fn must_complete(self) -> MustComplete<Self>
where Self: Sized,

Make sure that the stream will complete. Any requests to cancel the stream through poll_cancel will be ignored.
Source§

fn next(&mut self) -> Next<'_, Self>
where Self: Unpin,

Get the next item in the stream. Read more
Source§

fn count(self) -> Count<Self>
where Self: Sized,

Count the number of items in the stream. Read more
Source§

fn last(self) -> Last<Self>
where Self: Sized,

Get the last element in the stream. Read more
Source§

fn nth(&mut self, n: usize) -> Nth<'_, Self>
where Self: Unpin,

Get the nth element in the stream. Read more
Source§

fn step_by(self, step: usize) -> StepBy<Self>
where Self: Sized,

Create a stream starting at the same point, but stepping by the given amount each iteration. Read more
Source§

fn chain<U: CompletionStream<Item = Self::Item>>( self, other: U, ) -> Chain<Self, U>
where Self: Sized,

Chain this stream with another. Read more
Source§

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

Map this stream’s items with a closure. Read more
Source§

fn then<F: FnMut(Self::Item) -> Fut, Fut: CompletionFuture>( self, f: F, ) -> Then<Self, F, Fut>
where Self: Sized,

Map this stream’s items with an asynchronous closure. Read more
Source§

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

Call a closure on each item the stream. Read more
Source§

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

Keep the values in the stream for which the predicate resolves to true. Read more
Source§

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

Filter and map the items of the stream with a closure. Read more
Source§

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

Yield the current iteration count as well as the next value. Read more
Source§

fn peekable(self) -> Peekable<Self>
where Self: Sized,

Create a stream which can use peek to look at the next element of the stream without consuming it. Read more
Source§

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

Skip items while the predicate returns true. Read more
Source§

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

Take items while the predicate returns true. Read more
Source§

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

Skip the first n items in the stream. Read more
Source§

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

Takes the first n items of the stream. All other items will be ignored. Read more
Source§

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

Map the stream, flattening nested structure. Read more
Source§

fn flatten(self) -> Flatten<Self>
where Self: Sized, Self::Item: CompletionStream,

Flatten nested structure in the stream. Read more
Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Fuse the stream so that it is guaranteed to continue to yield None when exhausted. Read more
Source§

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

Do something with each element in the stream, passing the value on. Read more
Source§

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

Collect all the items in the stream into a collection. Read more
Source§

fn fold<T, F>(self, init: T, f: F) -> Fold<Self, F, T>
where F: FnMut(T, Self::Item) -> T, Self: Sized,

Accumulate a value over a stream. Read more
Source§

fn all<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> All<'_, Self, F>
where Self: Unpin,

Check if all the elements in the stream match a predicate. Read more
Source§

fn any<F: FnMut(Self::Item) -> bool>(&mut self, f: F) -> Any<'_, Self, F>
where Self: Unpin,

Check if any of the elements in the stream match a predicate. Read more
Source§

fn find<P>(&mut self, predicate: P) -> Find<'_, Self, P>
where Self: Unpin, P: FnMut(&Self::Item) -> bool,

Search for an element in the stream that satisfies a predicate. Read more
Source§

fn find_map<B, F>(&mut self, f: F) -> FindMap<'_, Self, F>
where Self: Unpin, F: FnMut(Self::Item) -> Option<B>,

Finds the first element in a stream for which a function returns Some. Read more
Source§

fn position<P>(&mut self, predicate: P) -> Position<'_, Self, P>
where Self: Unpin, P: FnMut(Self::Item) -> bool,

Get the index of an element in the stream. Read more
Source§

fn max(self) -> Max<Self>
where Self: Sized, Self::Item: Ord,

Find the maximum value in the stream. Read more
Source§

fn max_by<F>(self, compare: F) -> MaxBy<Self, F>
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Find the maximum value in the stream using the specified comparison function. Read more
Source§

fn max_by_key<B, F>(self, f: F) -> MaxByKey<Self, B, F>
where Self: Sized, B: Ord, F: FnMut(&Self::Item) -> B,

Find the element that gives the maximum value from the specified function. Read more
Source§

fn min(self) -> Min<Self>
where Self: Sized, Self::Item: Ord,

Find the minimum value in the stream. Read more
Source§

fn min_by<F>(self, compare: F) -> MinBy<Self, F>
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Find the minimum value in the stream using the specified comparison function. Read more
Source§

fn min_by_key<B, F>(self, f: F) -> MinByKey<Self, B, F>
where Self: Sized, B: Ord, F: FnMut(&Self::Item) -> B,

Find the element that gives the minimum value from the specified function. Read more
Source§

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

Copy all of the elements in the stream. Read more
Source§

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

Clone all of the elements in the stream. Read more
Source§

fn cycle(self) -> Cycle<Self>
where Self: Sized + Clone,

Repeat the stream endlessly. Read more
Source§

fn boxed<'a>(self) -> BoxCompletionStream<'a, Self::Item>
where Self: Sized + Send + 'a,

Available on crate feature alloc only.
Box the stream, erasing its type. Read more
Source§

fn boxed_local<'a>(self) -> LocalBoxCompletionStream<'a, Self::Item>
where Self: Sized + 'a,

Available on crate feature alloc only.
Box the stream locally, erasing its type. 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> StreamExt for T
where T: Stream,

Source§

fn into_completion(self) -> Adapter<Self>

Convert this stream into a CompletionStream. 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.
Source§

impl<S, T, E> TryStream for S
where S: Stream<Item = Result<T, E>> + ?Sized,

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll_next( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

Poll this TryStream as if it were a Stream. Read more