Struct toy_rpc::codec::Codec[][src]

pub struct Codec<R, W, C> {
    pub reader: R,
    pub writer: W,
    // some fields omitted
}

Default codec. Codec is re-exported as DefaultCodec when one of these feature flags is toggled (serde_bincode, serde_json, serde_cbor, serde_rmp“)

Fields

reader: Rwriter: W

Implementations

impl<R, W> Codec<R, W, ConnTypeReadWrite> where
    R: AsyncRead + Send + Sync + Unpin,
    W: AsyncWrite + Send + Sync + Unpin
[src]

pub fn with_reader_writer(reader: R, writer: W) -> Self[src]

impl<T> Codec<BufReader<ReadHalf<T>>, BufWriter<WriteHalf<T>>, ConnTypeReadWrite> where
    T: AsyncRead + AsyncWrite + Send + Sync + Unpin
[src]

pub fn new(stream: T) -> Self[src]

impl<S, E> Codec<StreamHalf<SplitStream<S>, CanSink>, SinkHalf<SplitSink<S, WsMessage>, CanSink>, ConnTypePayload> where
    S: Stream<Item = Result<WsMessage, E>> + Sink<WsMessage> + Send + Sync + Unpin,
    E: Error + 'static, 
[src]

pub fn with_websocket(ws: WebSocketConn<S, CanSink>) -> Self[src]

impl Codec<StreamHalf<WebSocketConnection, CannotSink>, SinkHalf<WebSocketConnection, CannotSink>, ConnTypePayload>[src]

pub fn with_tide_websocket(
    ws: WebSocketConn<WebSocketConnection, CannotSink>
) -> Self
[src]

impl<S, E> Codec<SplitStream<S>, SplitSink<S, Message>, ConnTypePayload> where
    S: Stream<Item = Result<Message, E>> + Sink<Message>,
    E: Error
[src]

pub fn with_warp_websocket(ws: S) -> Self[src]

Trait Implementations

impl<R, W> GracefulShutdown for Codec<R, W, ConnTypeReadWrite> where
    R: AsyncRead + Send + Sync + Unpin,
    W: AsyncWrite + Send + Sync + Unpin
[src]

impl<R, W> GracefulShutdown for Codec<R, W, ConnTypePayload> where
    R: Send,
    W: GracefulShutdown + Send
[src]

Auto Trait Implementations

impl<R, W, C> RefUnwindSafe for Codec<R, W, C> where
    C: RefUnwindSafe,
    R: RefUnwindSafe,
    W: RefUnwindSafe

impl<R, W, C> Send for Codec<R, W, C> where
    C: Send,
    R: Send,
    W: Send

impl<R, W, C> Sync for Codec<R, W, C> where
    C: Sync,
    R: Sync,
    W: Sync

impl<R, W, C> Unpin for Codec<R, W, C> where
    C: Unpin,
    R: Unpin,
    W: Unpin

impl<R, W, C> UnwindSafe for Codec<R, W, C> where
    C: UnwindSafe,
    R: UnwindSafe,
    W: 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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,