[][src]Struct futures::compat::Compat

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

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

Methods

impl<T> Compat<T>[src]

Important traits for Compat<R>
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.

Important traits for &'_ mut F
pub fn get_ref(&self) -> &T[src]

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

Important traits for &'_ mut F
pub fn get_mut(&mut self) -> &mut T[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<Sp, Fut> Executor<Fut> for Compat<Sp> where
    Fut: Future<Item = (), Error = ()> + Send + 'static,
    &'a Sp: Spawn
[src]

impl<R> AsyncRead for Compat<R> where
    R: Unpin + AsyncRead
[src]

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

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

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.

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

impl<W> AsyncWrite for Compat<W> where
    W: Unpin + AsyncWrite
[src]

impl<R> Read for Compat<R> where
    R: Unpin + AsyncRead
[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<W> Write for Compat<W> where
    W: Unpin + AsyncWrite
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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

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

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

impl<Ex> Executor01CompatExt for Ex where
    Ex: Executor<Compat<UnitError<FutureObj<'static, ()>>>> + Clone + Send + 'static, 
[src]

impl<Fut> Future01CompatExt for Fut where
    Fut: Future
[src]

impl<St> Stream01CompatExt for St where
    St: Stream
[src]

impl<R> AsyncRead01CompatExt for R where
    R: AsyncRead
[src]

impl<W> AsyncWrite01CompatExt for W where
    W: AsyncWrite
[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<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<W> WriteBytesExt for W where
    W: Write + ?Sized