[][src]Struct async_codec::framed_std::Framed

pub struct Framed<S, C> { /* fields omitted */ }

A wrapper around a byte stream that uses an Encode + Decode type to produce a Sink + Stream

Implementations

impl<S, C: Encode + Decode> Framed<S, C>[src]

pub fn new(stream: S, codec: C) -> Self[src]

Create a new framed stream from a byte stream and a codec.

Trait Implementations

impl<S, C> Sink<<C as Encode>::Item> for Framed<S, C> where
    C: Encode,
    C::Error: Debug,
    S: AsyncWrite
[src]

type Error = WriteFrameError<C::Error>

The type of value produced by the sink when an error occurs.

impl<S, C> Stream for Framed<S, C> where
    C: Decode,
    S: AsyncRead
[src]

type Item = Result<C::Item, ReadFrameError<C::Error>>

Values yielded by the stream.

Auto Trait Implementations

impl<S, C> RefUnwindSafe for Framed<S, C> where
    C: RefUnwindSafe,
    S: RefUnwindSafe

impl<S, C> Send for Framed<S, C> where
    C: Send,
    S: Send

impl<S, C> Sync for Framed<S, C> where
    C: Sync,
    S: Sync

impl<S, C> Unpin for Framed<S, C> where
    C: Unpin,
    S: Unpin

impl<S, C> UnwindSafe for Framed<S, C> where
    C: UnwindSafe,
    S: 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<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]