[][src]Struct rmp_serialize::encode::Encoder

pub struct Encoder<'a> { /* fields omitted */ }

Represents MessagePack serialization implementation.

Note

MessagePack has no specification about how to encode variant types. Thus we are free to do whatever we want, so the given chose may be not ideal for you.

Every Rust variant value can be represented as a tuple of index and a value.

All instances of ErrorKind::Interrupted are handled by this function and the underlying operation is retried.

Methods

impl<'a> Encoder<'a>[src]

pub fn new(wr: &'a mut dyn Write) -> Encoder<'a>[src]

Creates a new MessagePack encoder whose output will be written to the writer specified.

Trait Implementations

impl<'a> Encoder for Encoder<'a>[src]

type Error = Error

The error type for method results.

fn emit_enum<F>(&mut self, _name: &str, f: F) -> Result<(), Error> where
    F: FnOnce(&mut Self) -> Result<(), Error>, 
[src]

Encodes and attempts to write the enum value into the Write.

Currently we encode variant types as a tuple of id with array of args, like: [id, [args...]]

fn emit_enum_variant<F>(
    &mut self,
    _name: &str,
    id: usize,
    len: usize,
    f: F
) -> Result<(), Error> where
    F: FnOnce(&mut Self) -> Result<(), Error>, 
[src]

Encodes and attempts to write a concrete variant value.

fn emit_enum_variant_arg<F>(&mut self, _idx: usize, f: F) -> Result<(), Error> where
    F: FnOnce(&mut Self) -> Result<(), Error>, 
[src]

Encodes and attempts to write a concrete variant value arguments.

Auto Trait Implementations

impl<'a> !Send for Encoder<'a>

impl<'a> Unpin for Encoder<'a>

impl<'a> !Sync for Encoder<'a>

impl<'a> !UnwindSafe for Encoder<'a>

impl<'a> !RefUnwindSafe for Encoder<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<S> EncoderHelpers for S where
    S: Encoder
[src]