[][src]Struct twitchchat::AsyncEncoder

pub struct AsyncEncoder<W> { /* fields omitted */ }
This is supported on crate feature async only.

An asynchronous encoder.

Implementations

impl<W> AsyncEncoder<W> where
    W: Write + Send + Sync
[src]

pub fn encode_sync<M>(&mut self, msg: M) -> IoResult<()> where
    M: Encodable + Send + Sync
[src]

If the wrapped writer is synchronous, you can use this method to encode the message to it.

impl<W> AsyncEncoder<W> where
    W: AsyncWrite + Send + Sync + Unpin
[src]

pub fn new(writer: W) -> Self[src]

Create a new Encoder over this futures_lite::AsyncWrite instance

pub async fn into_inner(__arg0: Self) -> IoResult<W>[src]

Get the inner futures_lite::AsyncWrite instance out

This writes and flushes any buffered data before it consumes self.

pub async fn encode<M, '_>(&'_ mut self, msg: M) -> IoResult<()> where
    M: Encodable + Send + Sync,
    W: Unpin
[src]

Encode this Encodable message to the writer.

This flushes the data before returning

Trait Implementations

impl<W> AsyncWrite for AsyncEncoder<W> where
    W: AsyncWrite + Unpin + Send + Sync
[src]

impl<W> Clone for AsyncEncoder<W> where
    W: Clone
[src]

impl<W> Debug for AsyncEncoder<W>[src]

impl<W> Write for AsyncEncoder<W> where
    W: Write + Send + Sync
[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for AsyncEncoder<W> where
    W: RefUnwindSafe

impl<W> Send for AsyncEncoder<W> where
    W: Send

impl<W> Sync for AsyncEncoder<W> where
    W: Sync

impl<W> Unpin for AsyncEncoder<W> where
    W: Unpin

impl<W> UnwindSafe for AsyncEncoder<W> where
    W: UnwindSafe

Blanket Implementations

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

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized

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> FuturesAsyncWriteCompatExt for T where
    T: AsyncWrite
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

impl<T> WriteExt for T where
    T: AsyncWrite + ?Sized