Struct futures_util::compat::Compat[][src]

#[must_use = "futures do nothing unless you `.await` or poll them"]pub struct Compat<T> { /* fields omitted */ }

Converts a futures 0.3 TryFuture or TryStream into a futures 0.1 Future or Stream.

Implementations

impl<T> Compat<T>[src]

pub fn new(inner: T) -> Self[src]

Creates a new Compat.

For types which implement appropriate futures 0.3 traits, the result will be a type which implements the corresponding futures 0.1 type.

pub fn get_ref(&self) -> &T

Notable traits for &'_ mut F

impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Get a reference to 0.3 Future, Stream, AsyncRead, or AsyncWrite object contained within.

pub fn get_mut(&mut self) -> &mut T

Notable traits for &'_ mut F

impl<'_, F> Future for &'_ mut F where
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;
[src]

Get a mutable reference to 0.3 Future, Stream, AsyncRead, or AsyncWrite object contained within.

pub fn into_inner(self) -> T[src]

Returns the inner item.

Trait Implementations

impl<T: Clone> Clone for Compat<T>[src]

impl<T: Copy> Copy for Compat<T>[src]

impl<T: Debug> Debug for Compat<T>[src]

impl<Sp, Fut> Executor<Fut> for Compat<Sp> where
    &'a Sp: Spawn03,
    Fut: Future01<Item = (), Error = ()> + Send + 'static, 
[src]

impl<Fut> Future for Compat<Fut> where
    Fut: TryFuture03 + Unpin
[src]

type Item = Fut::Ok

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

type Error = Fut::Error

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

impl<St> Stream for Compat<St> where
    St: TryStream03 + Unpin
[src]

type Item = St::Ok

The type of item this stream will yield on success.

type Error = St::Error

The type of error this stream may generate.

Auto Trait Implementations

impl<T> RefUnwindSafe for Compat<T> where
    T: RefUnwindSafe

impl<T> Send for Compat<T> where
    T: Send

impl<T> Sync for Compat<T> where
    T: Sync

impl<T> Unpin for Compat<T> where
    T: Unpin

impl<T> UnwindSafe for Compat<T> where
    T: 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.