Struct futures::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) -> Compat<T>[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: Unpin + Future + ?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: Unpin + Future + ?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 for Compat<T> where
    T: Clone
[src]

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

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

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

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

type Item = <Fut as TryFuture>::Ok

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

type Error = <Fut as TryFuture>::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: TryStream + Unpin
[src]

type Item = <St as TryStream>::Ok

The type of item this stream will yield on success.

type Error = <St as TryStream>::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<Ex> Executor01CompatExt for Ex where
    Ex: Executor<Compat<UnitError<FutureObj<'static, ()>>>> + Clone + Send + 'static, 
[src]

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

impl<Fut> Future01CompatExt for Fut where
    Fut: Future
[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<St> Stream01CompatExt for St where
    St: Stream
[src]

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.