Struct serde_urlencoded::Serializer [−][src]
pub struct Serializer<'input, 'output, Target: UrlEncodedTarget> { /* fields omitted */ }
Expand description
A serializer for the application/x-www-form-urlencoded
format.
-
Supported top-level inputs are structs, maps and sequences of pairs, with or without a given length.
-
Supported keys and values are integers, bytes (if convertible to strings), unit structs and unit variants.
-
Newtype structs defer to their inner values.
Implementations
Returns a new Serializer
.
Trait Implementations
impl<'input, 'output, Target> Serializer for Serializer<'input, 'output, Target> where
Target: 'output + UrlEncodedTarget,
impl<'input, 'output, Target> Serializer for Serializer<'input, 'output, Target> where
Target: 'output + UrlEncodedTarget,
Returns Ok
.
Returns an error.
Serializes the inner value, ignoring the newtype name.
Returns an error.
Returns Ok
.
Serializes the given value.
Serialize a sequence, given length (if any) is ignored.
Returns an error.
fn serialize_tuple_struct(
self,
_name: &'static str,
_len: usize
) -> Result<Self::SerializeTupleStruct, Error>
fn serialize_tuple_struct(
self,
_name: &'static str,
_len: usize
) -> Result<Self::SerializeTupleStruct, Error>
Returns an error.
fn serialize_tuple_variant(
self,
_name: &'static str,
_variant_index: u32,
_variant: &'static str,
_len: usize
) -> Result<Self::SerializeTupleVariant, Error>
fn serialize_tuple_variant(
self,
_name: &'static str,
_variant_index: u32,
_variant: &'static str,
_len: usize
) -> Result<Self::SerializeTupleVariant, Error>
Returns an error.
Serializes a map, given length is ignored.
fn serialize_struct(
self,
_name: &'static str,
_len: usize
) -> Result<Self::SerializeStruct, Error>
fn serialize_struct(
self,
_name: &'static str,
_len: usize
) -> Result<Self::SerializeStruct, Error>
Serializes a struct, given length is ignored.
fn serialize_struct_variant(
self,
_name: &'static str,
_variant_index: u32,
_variant: &'static str,
_len: usize
) -> Result<Self::SerializeStructVariant, Error>
fn serialize_struct_variant(
self,
_name: &'static str,
_variant_index: u32,
_variant: &'static str,
_len: usize
) -> Result<Self::SerializeStructVariant, Error>
Returns an error.
type Ok = &'output mut UrlEncodedSerializer<'input, Target>
type Ok = &'output mut UrlEncodedSerializer<'input, Target>
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. Read more
type SerializeSeq = SeqSerializer<'input, 'output, Target>
type SerializeSeq = SeqSerializer<'input, 'output, Target>
Type returned from serialize_seq
for serializing the content of the
sequence. Read more
type SerializeTuple = TupleSerializer<'input, 'output, Target>
type SerializeTuple = TupleSerializer<'input, 'output, Target>
Type returned from serialize_tuple
for serializing the content of
the tuple. Read more
type SerializeTupleStruct = TupleStructSerializer<'input, 'output, Target>
type SerializeTupleStruct = TupleStructSerializer<'input, 'output, Target>
Type returned from serialize_tuple_struct
for serializing the
content of the tuple struct. Read more
type SerializeTupleVariant = TupleVariantSerializer<'input, 'output, Target>
type SerializeTupleVariant = TupleVariantSerializer<'input, 'output, Target>
Type returned from serialize_tuple_variant
for serializing the
content of the tuple variant. Read more
type SerializeMap = MapSerializer<'input, 'output, Target>
type SerializeMap = MapSerializer<'input, 'output, Target>
Type returned from serialize_map
for serializing the content of the
map. Read more
type SerializeStruct = StructSerializer<'input, 'output, Target>
type SerializeStruct = StructSerializer<'input, 'output, Target>
Type returned from serialize_struct
for serializing the content of
the struct. Read more
type SerializeStructVariant = StructVariantSerializer<'input, 'output, Target>
type SerializeStructVariant = StructVariantSerializer<'input, 'output, Target>
Type returned from serialize_struct_variant
for serializing the
content of the struct variant. Read more
Serialize an i128
value. Read more
Serialize a u128
value. Read more
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Serialize,
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Serialize,
Collect an iterator as a sequence. Read more
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
K: Serialize,
V: Serialize,
I: IntoIterator<Item = (K, V)>,
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
K: Serialize,
V: Serialize,
I: IntoIterator<Item = (K, V)>,
Collect an iterator as a map. Read more
Serialize a string produced by an implementation of Display
. Read more
Determine whether Serialize
implementations should serialize in
human-readable form. Read more