Trait CompatExt

Source
pub trait CompatExt {
    // Required methods
    fn compat(self) -> Compat<Self> 
       where Self: Sized;
    fn compat_ref(&self) -> Compat<&Self> ;
    fn compat_mut(&mut self) -> Compat<&mut Self> ;
}
Expand description

Applies the Compat adapter to futures and I/O types.

Required Methods§

Source

fn compat(self) -> Compat<Self>
where Self: Sized,

Applies the Compat adapter by value.

§Examples
use async_compat::CompatExt;

let stdout = tokio::io::stdout().compat();
Source

fn compat_ref(&self) -> Compat<&Self>

Applies the Compat adapter by shared reference.

§Examples
use async_compat::CompatExt;

let original = tokio::io::stdout();
let stdout = original.compat_ref();
Source

fn compat_mut(&mut self) -> Compat<&mut Self>

Applies the Compat adapter by mutable reference.

§Examples
use async_compat::CompatExt;

let mut original = tokio::io::stdout();
let stdout = original.compat_mut();

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> CompatExt for T