[][src]Struct futures::stream::StreamFuture

#[must_use = "futures do nothing unless polled"]
pub struct StreamFuture<S> { /* fields omitted */ }

A combinator used to temporarily convert a stream into a future.

This future is returned by the Stream::into_future method.

Methods

impl<S> StreamFuture<S>[src]

pub fn get_ref(&self) -> Option<&S>[src]

Acquires a reference to the underlying stream that this combinator is pulling from.

This method returns an Option to account for the fact that StreamFuture's implementation of Future::poll consumes the underlying stream during polling in order to return it to the caller of Future::poll if the stream yielded an element.

pub fn get_mut(&mut self) -> Option<&mut S>[src]

Acquires a mutable reference to the underlying stream that this combinator is pulling from.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.

This method returns an Option to account for the fact that StreamFuture's implementation of Future::poll consumes the underlying stream during polling in order to return it to the caller of Future::poll if the stream yielded an element.

pub fn into_inner(self) -> Option<S>[src]

Consumes this combinator, returning the underlying stream.

Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.

This method returns an Option to account for the fact that StreamFuture's implementation of Future::poll consumes the underlying stream during polling in order to return it to the caller of Future::poll if the stream yielded an element.

Trait Implementations

impl<S: Debug> Debug for StreamFuture<S>[src]

impl<S: Stream> Future for StreamFuture<S>[src]

type Item = (Option<S::Item>, S)

The type of value that this future will resolved with if it is successful. Read more

type Error = (S::Error, S)

The type of error that this future will resolve with if it fails in a normal fashion. Read more

Auto Trait Implementations

impl<S> RefUnwindSafe for StreamFuture<S> where
    S: RefUnwindSafe

impl<S> Send for StreamFuture<S> where
    S: Send

impl<S> Sync for StreamFuture<S> where
    S: Sync

impl<S> Unpin for StreamFuture<S> where
    S: Unpin

impl<S> UnwindSafe for StreamFuture<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.