Struct tokio_jsoncodec::Codec[][src]

pub struct Codec<D, E> { /* fields omitted */ }

JSON-based codec.

Methods

impl<D, E> Codec<D, E>
[src]

Creates a new Codec.

pretty controls whether or not encoded values are pretty-printed.

Set whether or not encoded values are pretty-printed.

Trait Implementations

impl<D: Clone, E: Clone> Clone for Codec<D, E>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<D: Debug, E: Debug> Debug for Codec<D, E>
[src]

Formats the value using the given formatter. Read more

impl<D, E> Default for Codec<D, E>
[src]

Returns the "default value" for a type. Read more

impl<D, E> Decoder for Codec<D, E> where
    D: Deserialize<'de>, 
[src]

The type of decoded frames.

The type of unrecoverable frame decoding errors. Read more

Attempts to decode a frame from the provided buffer of bytes. Read more

A default method available to be called when there are no more bytes available to be read from the underlying I/O. Read more

Provides a Stream and Sink interface for reading and writing to this Io object, using Decode and Encode to read and write the raw data. Read more

impl<D, E> Encoder for Codec<D, E> where
    E: Serialize
[src]

The type of items consumed by the Encoder

The type of encoding errors. Read more

Encodes a frame into the buffer provided. Read more

Auto Trait Implementations

impl<D, E> Send for Codec<D, E> where
    D: Send,
    E: Send

impl<D, E> Sync for Codec<D, E> where
    D: Sync,
    E: Sync