pub struct Serializer<W> { /* private fields */ }
Implementations§
Source§impl<W> Serializer<W>
impl<W> Serializer<W>
Source§impl<W> Serializer<IoWrite<W>>
impl<W> Serializer<IoWrite<W>>
pub fn from_writer(writer: W) -> Self
Trait Implementations§
Source§impl<'a, W> SerializeMap for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeMap for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeSeq for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeSeq for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeStruct for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeStruct for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeStructVariant for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeStructVariant for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeTuple for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeTuple for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeTupleStruct for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeTupleStruct for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> SerializeTupleVariant for &'a mut Serializer<W>where
W: Write,
impl<'a, W> SerializeTupleVariant for &'a mut Serializer<W>where
W: Write,
Source§impl<'a, W> Serializer for &'a mut Serializer<W>where
W: Write,
impl<'a, W> Serializer for &'a mut Serializer<W>where
W: Write,
Source§fn serialize_some<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
fn serialize_some<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
BARE type: optional<type>
Source§fn serialize_unit_struct(
self,
_name: &'static str,
) -> Result<Self::Ok, Self::Error>
fn serialize_unit_struct( self, _name: &'static str, ) -> Result<Self::Ok, Self::Error>
BARE type: void
Source§fn serialize_unit_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
) -> Result<Self::Ok, Self::Error>
fn serialize_unit_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, ) -> Result<Self::Ok, Self::Error>
BARE type: uint or (… | void | …)
name
and variant
are ignored.
Source§fn serialize_newtype_struct<T>(
self,
_name: &'static str,
value: &T,
) -> Result<Self::Ok, Self::Error>
fn serialize_newtype_struct<T>( self, _name: &'static str, value: &T, ) -> Result<Self::Ok, Self::Error>
BARE type: T
name
is ignored.
Source§fn serialize_newtype_variant<T>(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
value: &T,
) -> Result<Self::Ok, Self::Error>
fn serialize_newtype_variant<T>( self, _name: &'static str, variant_index: u32, _variant: &'static str, value: &T, ) -> Result<Self::Ok, Self::Error>
BARE type: { uint, T } or (… | T | …)
name
and variant
are ignored.
Source§fn serialize_seq(
self,
len: Option<usize>,
) -> Result<Self::SerializeSeq, Self::Error>
fn serialize_seq( self, len: Option<usize>, ) -> Result<Self::SerializeSeq, Self::Error>
BARE type if len is Some: []type BARE type [len]type is never used for variable-length sequences Error::SequenceLengthRequired if len is None
Source§fn serialize_tuple(
self,
_len: usize,
) -> Result<Self::SerializeTuple, Self::Error>
fn serialize_tuple( self, _len: usize, ) -> Result<Self::SerializeTuple, Self::Error>
BARE type: [len]type
len
is ignored.
Source§fn serialize_tuple_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<Self::SerializeTupleStruct, Self::Error>
fn serialize_tuple_struct( self, _name: &'static str, _len: usize, ) -> Result<Self::SerializeTupleStruct, Self::Error>
BARE type: struct
name
and len
are ignored.
Source§fn serialize_tuple_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<Self::SerializeTupleVariant, Self::Error>
fn serialize_tuple_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<Self::SerializeTupleVariant, Self::Error>
BARE type: { uint, T } or (… | T | …)
name
, variant
, and len
are ignored.
Source§fn serialize_map(
self,
len: Option<usize>,
) -> Result<Self::SerializeMap, Self::Error>
fn serialize_map( self, len: Option<usize>, ) -> Result<Self::SerializeMap, Self::Error>
BARE type: map[T]U Error::MapLengthRequired if len is None
Source§fn serialize_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<Self::SerializeStruct, Self::Error>
fn serialize_struct( self, _name: &'static str, _len: usize, ) -> Result<Self::SerializeStruct, Self::Error>
BARE type: struct
Source§fn serialize_struct_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<Self::SerializeStructVariant, Self::Error>
fn serialize_struct_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<Self::SerializeStructVariant, Self::Error>
BARE type: { uint, T } or (… | T | …)
Source§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Returns false.
Source§type Ok = ()
type Ok = ()
The output type produced by this
Serializer
during successful
serialization. Most serializers that produce text or binary output
should set Ok = ()
and serialize into an io::Write
or buffer
contained within the Serializer
instance. Serializers that build
in-memory data structures may be simplified by using Ok
to propagate
the data structure around.Source§type SerializeSeq = &'a mut Serializer<W>
type SerializeSeq = &'a mut Serializer<W>
Type returned from
serialize_seq
for serializing the content of the
sequence.Source§type SerializeTuple = &'a mut Serializer<W>
type SerializeTuple = &'a mut Serializer<W>
Type returned from
serialize_tuple
for serializing the content of
the tuple.Source§type SerializeTupleStruct = &'a mut Serializer<W>
type SerializeTupleStruct = &'a mut Serializer<W>
Type returned from
serialize_tuple_struct
for serializing the
content of the tuple struct.Source§type SerializeTupleVariant = &'a mut Serializer<W>
type SerializeTupleVariant = &'a mut Serializer<W>
Type returned from
serialize_tuple_variant
for serializing the
content of the tuple variant.Source§type SerializeMap = &'a mut Serializer<W>
type SerializeMap = &'a mut Serializer<W>
Type returned from
serialize_map
for serializing the content of the
map.Source§type SerializeStruct = &'a mut Serializer<W>
type SerializeStruct = &'a mut Serializer<W>
Type returned from
serialize_struct
for serializing the content of
the struct.Source§type SerializeStructVariant = &'a mut Serializer<W>
type SerializeStructVariant = &'a mut Serializer<W>
Type returned from
serialize_struct_variant
for serializing the
content of the struct variant.Source§fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
Collect an iterator as a sequence. Read more
Auto Trait Implementations§
impl<W> Freeze for Serializer<W>where
W: Freeze,
impl<W> RefUnwindSafe for Serializer<W>where
W: RefUnwindSafe,
impl<W> Send for Serializer<W>where
W: Send,
impl<W> Sync for Serializer<W>where
W: Sync,
impl<W> Unpin for Serializer<W>where
W: Unpin,
impl<W> UnwindSafe for Serializer<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more