[][src]Trait completion_core::CompletionStream

#[must_use = "streams do nothing unless you use them"]pub trait CompletionStream {
    type Item;
    pub unsafe fn poll_next(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Option<Self::Item>>; pub fn size_hint(&self) -> (usize, Option<usize>) { ... } }

A Stream where each value must be polled to completion.

All types that implement Stream should also implement this.

Associated Types

type Item[src]

Values yielded by the stream.

Loading content...

Required methods

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

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.

Safety

Once this function is called and the type does not also implement Stream, the user must not drop or forget the stream until it has returned Poll::Ready or panicked. Note that users may drop the stream in between finishing polling one item and starting to poll the next.

Loading content...

Provided methods

pub fn size_hint(&self) -> (usize, Option<usize>)[src]

Returns the bounds on the remaining length of the stream.

See Stream::size_hint for more details.

Loading content...

Implementations on Foreign Types

impl<S: CompletionStream + Unpin + ?Sized> CompletionStream for &mut S[src]

type Item = S::Item

impl<S: CompletionStream + Unpin + ?Sized> CompletionStream for Box<S>[src]

type Item = S::Item

impl<P> CompletionStream for Pin<P> where
    P: Unpin + DerefMut,
    P::Target: CompletionStream
[src]

type Item = <P::Target as CompletionStream>::Item

impl<S: CompletionStream> CompletionStream for AssertUnwindSafe<S>[src]

type Item = S::Item

Loading content...

Implementors

Loading content...