pub(crate) struct ContentSerializer<E> {
is_human_readable: bool,
error: PhantomData<E>,
}Fields§
§is_human_readable: bool§error: PhantomData<E>Implementations§
Trait Implementations§
Source§impl<E> Default for ContentSerializer<E>
impl<E> Default for ContentSerializer<E>
Source§impl<E> Serializer for ContentSerializer<E>where
E: SerError,
impl<E> Serializer for ContentSerializer<E>where
E: SerError,
Source§type Ok = Content
type Ok = Content
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 = SeqSerialize<E>
type SerializeSeq = SeqSerialize<E>
Type returned from
serialize_seq for serializing the content of the
sequence.Source§type SerializeTuple = TupleSerialize<E>
type SerializeTuple = TupleSerialize<E>
Type returned from
serialize_tuple for serializing the content of
the tuple.Source§type SerializeTupleStruct = TupleStructSerialize<E>
type SerializeTupleStruct = TupleStructSerialize<E>
Type returned from
serialize_tuple_struct for serializing the
content of the tuple struct.Source§type SerializeTupleVariant = TupleVariantSerialize<E>
type SerializeTupleVariant = TupleVariantSerialize<E>
Type returned from
serialize_tuple_variant for serializing the
content of the tuple variant.Source§type SerializeMap = MapSerialize<E>
type SerializeMap = MapSerialize<E>
Type returned from
serialize_map for serializing the content of the
map.Source§type SerializeStruct = StructSerialize<E>
type SerializeStruct = StructSerialize<E>
Type returned from
serialize_struct for serializing the content of
the struct.Source§type SerializeStructVariant = StructVariantSerialize<E>
type SerializeStructVariant = StructVariantSerialize<E>
Type returned from
serialize_struct_variant for serializing the
content of the struct variant.Source§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether
Serialize implementations should serialize in
human-readable form. Read moreSource§fn serialize_bytes(self, value: &[u8]) -> Result<Content, E>
fn serialize_bytes(self, value: &[u8]) -> Result<Content, E>
Serialize a chunk of raw byte data. Read more
Source§fn serialize_unit_variant(
self,
name: &'static str,
variant_index: u32,
variant: &'static str,
) -> Result<Content, E>
fn serialize_unit_variant( self, name: &'static str, variant_index: u32, variant: &'static str, ) -> Result<Content, E>
Source§fn serialize_newtype_struct<T>(
self,
name: &'static str,
value: &T,
) -> Result<Content, E>
fn serialize_newtype_struct<T>( self, name: &'static str, value: &T, ) -> Result<Content, E>
Serialize a newtype struct like
struct Millimeters(u8). Read moreSource§fn serialize_newtype_variant<T>(
self,
name: &'static str,
variant_index: u32,
variant: &'static str,
value: &T,
) -> Result<Content, E>
fn serialize_newtype_variant<T>( self, name: &'static str, variant_index: u32, variant: &'static str, value: &T, ) -> Result<Content, E>
Source§fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, E>
fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, E>
Begin to serialize a variably sized sequence. This call must be
followed by zero or more calls to
serialize_element, then a call to
end. Read moreSource§fn serialize_tuple(self, len: usize) -> Result<Self::SerializeTuple, E>
fn serialize_tuple(self, len: usize) -> Result<Self::SerializeTuple, E>
Begin to serialize a statically sized sequence whose length will be
known at deserialization time without looking at the serialized data.
This call must be followed by zero or more calls to
serialize_element,
then a call to end. Read moreSource§fn serialize_tuple_struct(
self,
name: &'static str,
len: usize,
) -> Result<Self::SerializeTupleStruct, E>
fn serialize_tuple_struct( self, name: &'static str, len: usize, ) -> Result<Self::SerializeTupleStruct, E>
Begin to serialize a tuple struct like
struct Rgb(u8, u8, u8). This
call must be followed by zero or more calls to serialize_field, then a
call to end. Read moreSource§fn serialize_tuple_variant(
self,
name: &'static str,
variant_index: u32,
variant: &'static str,
len: usize,
) -> Result<Self::SerializeTupleVariant, E>
fn serialize_tuple_variant( self, name: &'static str, variant_index: u32, variant: &'static str, len: usize, ) -> Result<Self::SerializeTupleVariant, E>
Begin to serialize a tuple variant like
E::T in enum E { T(u8, u8) }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read moreSource§fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, E>
fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, E>
Begin to serialize a map. This call must be followed by zero or more
calls to
serialize_key and serialize_value, then a call to end. Read moreSource§fn serialize_struct(
self,
name: &'static str,
len: usize,
) -> Result<Self::SerializeStruct, E>
fn serialize_struct( self, name: &'static str, len: usize, ) -> Result<Self::SerializeStruct, E>
Begin to serialize a struct like
struct Rgb { r: u8, g: u8, b: u8 }.
This call must be followed by zero or more calls to serialize_field,
then a call to end. Read moreSource§fn serialize_struct_variant(
self,
name: &'static str,
variant_index: u32,
variant: &'static str,
len: usize,
) -> Result<Self::SerializeStructVariant, E>
fn serialize_struct_variant( self, name: &'static str, variant_index: u32, variant: &'static str, len: usize, ) -> Result<Self::SerializeStructVariant, E>
Begin to serialize a struct variant like
E::S in enum E { S { r: u8, g: u8, b: u8 } }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read moreSource§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<E> Freeze for ContentSerializer<E>
impl<E> RefUnwindSafe for ContentSerializer<E>where
E: RefUnwindSafe,
impl<E> Send for ContentSerializer<E>where
E: Send,
impl<E> Sync for ContentSerializer<E>where
E: Sync,
impl<E> Unpin for ContentSerializer<E>where
E: Unpin,
impl<E> UnsafeUnpin for ContentSerializer<E>
impl<E> UnwindSafe for ContentSerializer<E>where
E: 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