Struct rmp::encode::serde::Serializer [] [src]

pub struct Serializer<'a> {
    // some 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> Serializer<'a>

fn new(wr: &'a mut Write) -> Serializer<'a>

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

Trait Implementations

impl<'a> Serializer for Serializer<'a>

type Error = Error

fn visit_unit(&mut self) -> Result<(), Error>

fn visit_bool(&mut self, val: bool) -> Result<(), Error>

fn visit_u8(&mut self, val: u8) -> Result<(), Error>

fn visit_u16(&mut self, val: u16) -> Result<(), Error>

fn visit_u32(&mut self, val: u32) -> Result<(), Error>

fn visit_u64(&mut self, val: u64) -> Result<(), Error>

fn visit_usize(&mut self, val: usize) -> Result<(), Error>

fn visit_i8(&mut self, val: i8) -> Result<(), Error>

fn visit_i16(&mut self, val: i16) -> Result<(), Error>

fn visit_i32(&mut self, val: i32) -> Result<(), Error>

fn visit_i64(&mut self, val: i64) -> Result<(), Error>

fn visit_isize(&mut self, val: isize) -> Result<(), Error>

fn visit_f32(&mut self, val: f32) -> Result<(), Error>

fn visit_f64(&mut self, val: f64) -> Result<(), Error>

fn visit_char(&mut self, val: char) -> Result<(), Error>

fn visit_str(&mut self, val: &str) -> Result<(), Error>

fn visit_unit_variant(&mut self, _name: &str, variant_index: usize, _variant: &str) -> Result<(), Error>

fn visit_tuple_variant<V>(&mut self, _name: &str, variant_index: usize, _variant: &str, visitor: V) -> Result<(), Error> where V: SeqVisitor

fn visit_struct_variant<V>(&mut self, _name: &str, _variant_index: usize, _variant: &str, _visitor: V) -> Result<(), Error> where V: MapVisitor

fn visit_none(&mut self) -> Result<(), Error>

fn visit_some<T>(&mut self, v: T) -> Result<(), Error> where T: Serialize

fn visit_seq<V>(&mut self, visitor: V) -> Result<(), Error> where V: SeqVisitor

fn visit_seq_elt<V>(&mut self, value: V) -> Result<(), Error> where V: Serialize

fn visit_map<V>(&mut self, visitor: V) -> Result<(), Error> where V: MapVisitor

fn visit_map_elt<K, V>(&mut self, key: K, value: V) -> Result<(), Error> where K: Serialize, V: Serialize

fn visit_struct<V>(&mut self, _name: &str, visitor: V) -> Result<(), Error> where V: MapVisitor

fn visit_struct_elt<V>(&mut self, _key: &str, value: V) -> Result<(), Error> where V: Serialize

fn visit_bytes(&mut self, value: &[u8]) -> Result<(), Error>

fn visit_unit_struct(&mut self, _name: &'static str) -> Result<(), Self::Error>

fn visit_newtype_struct<T>(&mut self, name: &'static str, value: T) -> Result<(), Self::Error> where T: Serialize

fn visit_newtype_variant<T>(&mut self, name: &'static str, variant_index: usize, variant: &'static str, value: T) -> Result<(), Self::Error> where T: Serialize

fn visit_tuple<V>(&mut self, visitor: V) -> Result<(), Self::Error> where V: SeqVisitor

fn visit_tuple_elt<T>(&mut self, value: T) -> Result<(), Self::Error> where T: Serialize

fn visit_tuple_struct<V>(&mut self, _name: &'static str, visitor: V) -> Result<(), Self::Error> where V: SeqVisitor

fn visit_tuple_struct_elt<T>(&mut self, value: T) -> Result<(), Self::Error> where T: Serialize

fn visit_tuple_variant_elt<T>(&mut self, value: T) -> Result<(), Self::Error> where T: Serialize

fn visit_struct_variant_elt<V>(&mut self, key: &'static str, value: V) -> Result<(), Self::Error> where V: Serialize

fn format() -> &'static str