[−][src]Struct rmp_serde::encode::Serializer
Represents MessagePack serialization implementation.
Note
MessagePack has no specification about how to encode enum types. Thus we are free to do whatever we want, so the given chose may be not ideal for you.
Every Rust enum value can be represented as a tuple of index with a value.
All instances of ErrorKind::Interrupted
are handled by this function and the underlying
operation is retried.
Implementations
impl<W: Write> Serializer<W, StructMapWriter>
[src][−]
pub fn new_named(wr: W) -> Self
[src][−]
Constructs a new MessagePack
serializer whose output will be written to the writer
specified.
Note
This is the default constructor, which returns a serializer that will serialize structs using large named representation.
impl<W, V> Serializer<W, V>
[src][−]
pub fn set_max_depth(&mut self, depth: usize)
[src][−]
Changes the maximum nesting depth that is allowed
impl<W: Write> Serializer<W, StructArrayWriter>
[src][−]
pub fn new(wr: W) -> Self
[src][−]
Constructs a new MessagePack
serializer whose output will be written to the writer
specified.
Note
This is the default constructor, which returns a serializer that will serialize structs using compact tuple representation, without field names.
pub fn compact(wr: W) -> Self
[src]
impl<W: Write, V> Serializer<W, V>
[src][−]
pub fn get_ref(&self) -> &W
[src][−]
Gets a reference to the underlying writer.
pub fn get_mut(&mut self) -> &mut W
[src][−]
Gets a mutable reference to the underlying writer.
It is inadvisable to directly write to the underlying writer.
pub fn into_inner(self) -> W
[src][−]
Unwraps this Serializer
, returning the underlying writer.
impl<W: Write, V: VariantWriter> Serializer<W, V>
[src][−]
pub fn with(wr: W, vw: V) -> Self
[src][−]
Creates a new MessagePack encoder whose output will be written to the writer specified.
Trait Implementations
impl<'a, W: Write, V: VariantWriter> Serializer for &'a mut Serializer<W, V>
[src][+]
Auto Trait Implementations
impl<W, V> RefUnwindSafe for Serializer<W, V> where
V: RefUnwindSafe,
W: RefUnwindSafe,
V: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, V> Send for Serializer<W, V> where
V: Send,
W: Send,
V: Send,
W: Send,
impl<W, V> Sync for Serializer<W, V> where
V: Sync,
W: Sync,
V: Sync,
W: Sync,
impl<W, V> Unpin for Serializer<W, V> where
V: Unpin,
W: Unpin,
V: Unpin,
W: Unpin,
impl<W, V> UnwindSafe for Serializer<W, V> where
V: UnwindSafe,
W: UnwindSafe,
V: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,