serde 0.6.0

A generic serialization/deserialization framework
Documentation
b0VIM 7.4���U�6��JericktErick-Tryzelaar-MBP.local~erickt/projects/rust/serde/serde/serde/src/ser/mod.rsutf-8
3210#"! Utp	Yj;	9�
�b�ad�-����zy-,������n^]-�
�
�
^
P

����]O����`R�
�
�
�
a
S

�	�	�	�	�	n	m		���mgf���rlk	���sml
���tnm?1���hZ������ ��U�����    /// `visit_str` serializes a `&str`.    }        self.visit_str(&v.to_string())        // doesn't support encoding a `char` into a stack buffer.        // FIXME: this allocation is required in order to be compatible with stable rust, which    fn visit_char(&mut self, v: char) -> Result<(), Self::Error> {    #[inline]    /// single character.    /// `visit_char` serializes a character. By default it serializes it as a `&str` containing a    fn visit_f64(&mut self, v: f64) -> Result<(), Self::Error>;    /// `visit_f64` serializes a `f64` value.    }        self.visit_f64(v as f64)    fn visit_f32(&mut self, v: f32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_f64` method.    /// `visit_f32` serializes a `f32` value. By default it casts the value to a `f64` and passes    fn visit_u64(&mut self, v: u64) -> Result<(), Self::Error>;    #[inline]    /// `visit_u64` serializes a `u64` value.    }        self.visit_u64(v as u64)    fn visit_u32(&mut self, v: u32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u16(&mut self, v: u16) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u8(&mut self, v: u8) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u8` serializes a `u8` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_usize(&mut self, v: usize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_u64` method.    /// `visit_usize` serializes a `usize` value. By default it casts the value to a `u64` and    fn visit_i64(&mut self, v: i64) -> Result<(), Self::Error>;    #[inline]    /// `visit_i64` serializes a `i64` value.    }        self.visit_i64(v as i64)    fn visit_i32(&mut self, v: i32) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i32` serializes a `i32` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i16(&mut self, v: i16) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i16` serializes a `i16` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i8(&mut self, v: i8) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i8` serializes a `i8` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_isize(&mut self, v: isize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_isize` serializes a `isize` value. By default it casts the value to a `i64` and    fn visit_bool(&mut self, v: bool) -> Result<(), Self::Error>;    /// `visit_bool` serializes a `bool` value.    type Error;pub trait Serializer {///////////////////////////////////////////////////////////////////////////////}        where S: Serializer;    fn serialize<S>(&self, serializer: &mut S) -> Resu//// A trait that describes a type that can be serialized by a `Serializer`.///////////////////////////////////////////////////////////////////////////////pub mod impls;//! Generic serialization framework.ad�
���b\[A9��U��0�
�
�
�
p


���sVP0*)����^0�
�
�
�
�
�
{
s

�	�	�	N		��yMGF��I�����zr2������mV ��X;:������xa0(��hKJ
����}    }        None    fn len(&self) -> Option<usize> {    #[inline]    /// Return the length of the map if known.        where S: Serializer;    fn visit<S>(&mut self, serializer: &mut S) -> Result<Option<()>, S::Error>    /// complete.    /// This returns `Ok(Some(()))` when there are more items to serialize, or `Ok(None)` when    ///    /// Serializes a map item in the serializer.pub trait MapVisitor {/// A trait that is used by a `Serializer` to iterate through a map.}    }        None    fn len(&self) -> Option<usize> {    #[inline]    /// Return the length of the sequence if known.        where S: Serializer;    fn visit<S>(&mut self, serializer: &mut S) -> Result<Option<()>, S::Error>    /// complete.    /// This returns `Ok(Some(()))` when there are more items to serialize, or `Ok(None)` when    ///    /// Serializes a sequence item in the serializer.pub trait SeqVisitor {/// A trait that is used by a `Serialize` to iterate through a sequence.}    }        ""    fn format() -> &'static str {    /// specific field attributes should be used with the serializer.    /// The serializer format is used to determine which format    ///    /// Specify a format string for the serializer.    }        self.visit_struct_elt(key, value)    {        where V: Serialize,                                   value: V) -> Result<(), Self::Error>                                   key: &'static str,    fn visit_struct_variant_elt<V>(&mut self,    #[inline]    /// By default, struct variant elements are serialized as a struct element.    ///    /// Serializes an element of a struct variant.    }        self.visit_struct(variant, visitor)    {        where V: MapVisitor,                               visitor: V) -> Result<(), Self::Error>                               variant: &'static str,                               _variant_index: usize,                               _name: &'static str,    fn visit_struct_variant<V>(&mut self,    #[inline]    /// in the struct variant. By default, struct variants are serialized as a struct.    /// Callees of this method need to construct a `MapVisitor`, which iterates through each item    ///    /// Serializes a struct variant.    }        self.visit_map_elt(key, value)    {        where V: Serialize,                           value: V) -> Result<(), Self::Error>                           key: &'static str,    fn visit_struct_elt<V>(&mut self,    #[inline]    /// By default, struct elements are serialized as a map element with the field name as the key.    ///    /// Serializes an element of a struct.    }        self.visit_map(visitor)    {        where V: MapVisitor,                       visitor: V) -> Result<(), Self::Error>                       _name: &'static str,    fn visit_struct<V>(&mut self,    #[inline]    /// in the struct. By default, structs are serialized as a map with the field name as the key.    /// Callees of this method need to construct a `MapVisitor`, which iterates through each item    ///    /// Serializes a struct.              V: Serialize;        where K: Serialize,    fn visit_map_elt<K, V>(&mut self,    /// in the struct. By defau    /// in the struct. By default, structs are serialized as a map with the        /// in the map.    /// Callees of this method need to construct a `MapVisitor`, which iterates through each item    ///    /// Serializes a map.    }        self.visit_tuple_struct_elt(value)    {        where T: Serialize    fn visit_tuple_variant_elt<T>(&mut self, value: T) -> Result<(), Self::Error>ad�_��X���HBA �
�
�
�
{
m

�����_nhg�XJ �
�
�
�
T
N
M
�	�	j	\	1	���K/)������lk&
	���]A@2�������H-'�����R5/
����b\[M$���B%����    #[inline]    }        self.visit_tuple_struct(variant, visitor)    {        where V: SeqVisitor,                              visitor: V) -> Result<(), Self::Error>                              variant: &'static str,                              _variant_index: usize,                              _name: &'static str,    fn visit_tuple_variant<V>(&mut self,    #[inline]    }        self.visit_tuple_elt(value)    {        where T: Serialize    fn visit_tuple_struct_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    }        self.visit_tuple(visitor)    {        where V: SeqVisitor,                             visitor: V) -> Result<(), Self::Error>                             _name: &'static str,    fn visit_tuple_struct<V>(&mut self,    #[inline]    }        self.visit_seq_elt(value)    {        where T: Serialize    fn visit_tuple_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    }        self.visit_seq(visitor)    {        where V: SeqVisitor,    fn visit_tuple<V>(&mut self, visitor: V) -> Result<(), Self::Error>    #[inline]        where T: Serialize;    fn visit_seq_elt<T>(&mut self, value: T) -> Result<(), Self::Error>        where V: SeqVisitor;    fn visit_seq<V>(&mut self, visitor: V) -> Result<(), Self::Error>        where V: Serialize;    fn visit_some<V>(&mut self, value: V) -> Result<(), Self::Error>    fn visit_none(&mut self) -> Result<(), Self::Error>;    }            Some(value))            variant,            variant_index,            name,        self.visit_tuple_variant(    {        where T: Serialize,                                value: T) -> Result<(), Self::Error>                                variant: &'static str,                                variant_index: usize,                                name: &'static str,    fn visit_newtype_variant<T>(&mut self,    #[inline]    /// tuple variant sequence.    /// serialized than a variant with multiple items. By default it just serializes the value as a    /// The `visit_newtype_variant` allows a variant with a single item to be more efficiently    }        self.visit_tuple_struct(name, Some(value))    {        where T: Serialize,                               value: T) -> Result<(), Self::Error>                               name: &'static str,    fn visit_newtype_struct<T>(&mut self,    #[inline]    /// By default it just serializes the value as a tuple struct sequence.    /// newtyped value, to be more efficiently serialized than a tuple struct with multiple items.    /// The `visit_newtype_struct` allows a tuple struct with a single element, also kno    /// By default, unit variants are serialized as a `()`.    ///    /// Serializes a unit variant, otherwise known as a variant with no arguments.    }        self.visit_unit()    fn visit_unit_struct(&mut self, _name: &'static str) -> Result<(), Self::Error> {    #[inline]    /// By default, unit structs are serialized as a `()`.    ///    /// Serializes a unit struct value.    fn visit_unit(&mut self) -> Result<(), Self::Error>;    /// Serializes a `()` value.    }        self.visit_seq(impls::SeqIteratorVisitor::new(value.iter(), Some(value.len())))    fn visit_bytes(&mut self, value: &[u8]) -> Result<(), Self::Error> {    #[inline]    /// byte slices separately from generic arrays. By default it serializes as a regular array.    /// `visit_bytes` is a hook that enables those serialization formats that support serializing    fn visit_str(&mut self, value: &str) -> Result<(), Self::Error>;ad�
,��oRPO����,8M�
�
{
N
@
����zM?���}PB�
�
�
~
Q
C

�	�	�	�	�	^	]	���~]WV����b\[����c]\����d^]/!��~XJ	����sr���E����    /// `visit_str` serializes a `&str`.    }        self.visit_str(&v.to_string())        // doesn't support encoding a `char` into a stack buffer.        // FIXME: this allocation is required in order to be compatible with stable rust, which    fn visit_char(&mut self, v: char) -> Result<(), Self::Error> {    #[inline]    /// single character.    /// `visit_char` serializes a character. By default it serializes it as a `&str` containing a    fn visit_f64(&mut self, v: f64) -> Result<(), Self::Error>;    /// `visit_f64` serializes a `f64` value.    }        self.visit_f64(v as f64)    fn visit_f32(&mut self, v: f32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_f64` method.    /// `visit_f32` serializes a `f32` value. By default it casts the value to a `f64` and passes    fn visit_u64(&mut self, v: u64) -> Result<(), Self::Error>;    #[inline]    /// `visit_u64` serializes a `u64` value.    }        self.visit_u64(v as u64)    fn visit_u32(&mut self, v: u32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u16(&mut self, v: u16) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u8(&mut self, v: u8) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u8` serializes a `u8` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_usize(&mut self, v: usize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_u64` method.    /// `visit_usize` serializes a `usize` value. By default it casts the value to a `u64` and    fn visit_i64(&mut self, v: i64) -> Result<(), Self::Error>;    #[inline]    /// `visit_i64` serializes a `i64` value.    }        self.visit_i64(v as i64)    fn visit_i32(&mut self, v: i32) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i32` serializes a `i32` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i16(&mut self, v: i16) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i16` serializes a `i16` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i8(&mut self, v: i8) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i8` serializes a `i8` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_isize(&mut self, v: isize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_isize` serializes a `isize` value. By default it casts the value to a `i64` and    fn visit_bool(&mut self, v: bool) -> Result<(), Self::Error>;    /// `visit_    /// The error type that can be returned if some error occurs during serialization.pub trait Serializer {/// A trait that describes a type that can serialize a stream of values into the underlying format.///////////////////////////////////////////////////////////////////////////////}        where S: Serializer;    fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>    /// Serializes this value into this serializer.pub trait Serialize {ad�NY���}|���|vu�
�
�
�
{
z

����|{ ����}|N@�
�
s
e
 
�	�	�	�	r	d	%		���ug&���vh'����� ������U���G��~xwN    /// `visit_str` serializes a `&str`.    }        self.visit_str(&v.to_string())        // doesn't support encoding a `char` into a stack buffer.        // FIXME: this allocation is required in order to be compatible with stable rust, which    fn visit_char(&mut self, v: char) -> Result<(), Self::Error> {    #[inline]    /// single character.    /// `visit_char` serializes a character. By default it serializes it as a `&str` containing a    fn visit_f64(&mut self, v: f64) -> Result<(), Self::Error>;    /// `visit_f64` serializes a `f64` value.    }        self.visit_f64(v as f64)    fn visit_f32(&mut self, v: f32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_f64` method.    /// `visit_f32` serializes a `f32` value. By default it casts the value to a `f64` and passes    fn visit_u64(&mut self, v: u64) -> Result<(), Self::Error>;    #[inline]    /// `visit_u64` serializes a `u64` value.    }        self.visit_u64(v as u64)    fn visit_u32(&mut self, v: u32) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u16(&mut self, v: u16) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u32` serializes a `u32` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_u8(&mut self, v: u8) -> Result<(), Self::Error> {    #[inline]    /// it to the `visit_u64` method.    /// `visit_u8` serializes a `u8` value. By default it casts the value to a `u64` and passes    }        self.visit_u64(v as u64)    fn visit_usize(&mut self, v: usize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_u64` method.    /// `visit_usize` serializes a `usize` value. By default it casts the value to a `u64` and    fn visit_i64(&mut self, v: i64) -> Result<(), Self::Error>;    #[inline]    /// `visit_i64` serializes a `i64` value.    }        self.visit_i64(v as i64)    fn visit_i32(&mut self, v: i32) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i32` serializes a `i32` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i16(&mut self, v: i16) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i16` serializes a `i16` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_i8(&mut self, v: i8) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_i8` serializes a `i8` value. By default it casts the value to a `i64` and    }        self.visit_i64(v as i64)    fn visit_isize(&mut self, v: isize) -> Result<(), Self::Error> {    #[inline]    /// passes it to the `visit_i64` method.    /// `visit_isize` serializes a `isize` value. By default it casts the value to a `i64` and    fn visit_bool(&mut self, v: bool) -> Result<(), Self::Error>;    /// `visit_bool` serializes a `bool` value.    type Error;ad\d;���m���:�
�
�
�
?
#

���� ���]&�
�
�
�
�
p
[
B
<
;

�	�	�	q	U	T	5	-	��lON'�����d^mgfB:���9������{7������e_;54(���T�������%��    #[inline]    /// in the tuple. By default, tuples are serialized as a sequence.    /// Callees of this method need to construct a `SeqVisitor`, which iterates through each item    ///    /// Serializes a tuple element.    }        self.visit_tuple_struct(variant, visitor)    {        where V: SeqVisitor,                              visitor: V) -> Result<(), Self::Error>                              variant: &'static str,                              _variant_index: usize,                              _name: &'static str,    fn visit_tuple_variant<V>(&mut self,    #[inline]    /// tbd    }        self.visit_tuple_elt(value)    {        where T: Serialize    fn visit_tuple_struct_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    /// tbd    }        self.visit_tuple(visitor)    {        where V: SeqVisitor,                             visitor: V) -> Result<(), Self::Error>                             _name: &'static str,    fn visit_tuple_struct<V>(&mut self,    #[inline]    /// tbd    }        self.visit_seq_elt(value)    {        where T: Serialize    fn visit_tuple_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    /// in the tuple. By default, tuples are serialized as a sequence.    /// Callees of this method need to construct a `SeqVisitor`, which iterates through each item    ///    /// Serializes a     /// By de    /// By default this serializes a tuple as a sequence.    ///    /// Serializes a tuple.        where T: Serialize;    fn visit_seq_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    /// Serializes a sequence element.        where V: SeqVisitor;    fn visit_seq<V>(&mut self, visitor: V) -> Result<(), Self::Error>    /// in the sequence.    /// Callees of this method need to construct a `SeqVisitor`, which iterates through each item    ///    /// Serializes a sequence.        where V: Serialize;    fn visit_some<V>(&mut self, value: V) -> Result<(), Self::Error>    /// Serializes a `Some(...)` value.    fn visit_none(&mut self) -> Result<(), Self::Error>;    /// Serializes a `None` value.    }            Some(value))            variant,            variant_index,            name,        self.visit_tuple_variant(    {        where T: Serialize,                                value: T) -> Result<(), Self::Error>                                variant: &'static str,                                variant_index: usize,                                name: &'static str,    fn visit_newtype_variant<T>(&mut self,    #[inline]    /// tuple variant sequence.    /// serialized than a variant with multiple items. By default it just serializes the value as a    /// The `visit_newtype_variant` allows a variant with a single item to be more efficiently    }        self.visit_tuple_struct(name, Some(value))    {        where T: Serialize,                               value: T) -> Result<(), Self::Error>                               name: &'static str,    fn visit_newtype_struct<T>(&mut self,    #[inline]    /// By default it just serializes the value as a tuple struct sequence.    /// newtyped value, to be more efficiently serialized than a tuple struct with multiple items.    /// The `visit_newtype_struct` allows a tuple struct with a single element, also known as a    }        self.visit_unit()                          _variant: &'static str) -> Result<(), Self::Error> {                          _variant_index: usize,                          _name: &'static str,    fn visit_unit_variant(&mut self,    #[inline]ad��b���i�����dV4�
�
�
�
�
�
U
M
����G+%������|R�
�
l
O
I



�	�	�	}	O		����~JB������=&���w(
�������H1���8������k�}    }        None    fn len(&self}    }        None    fn len(&self) -> Option<usize> {    #[inline]    }    }        None    fn len(&self) -> Option<usize> {    #[i}    }        None    fn len(&self) -> Option<usize> }    }        None    fn len(&self) -> Option<usize> {    #[inline]    /// Return the length of the map if known.        where S: Serializer;    fn visit<S>(&mut self, serializer: &mut S) -> Result<Option<()>, S::Error>    /// complete.    /// This returns `Ok(Some(()))` when there are more items to serialize, or `Ok(None)` when    ///    /// Serializes a map item in the serializer.pub trait MapVisitor {/// A trait that is used by a `Serializer` to iterate through a map.}    }        None    fn len(&self) -> Option<usize> {    #[inline]    /// Return the length of the sequence if known.        where S: Serializer;    fn visit<S>(&mut self, serializer: &mut S) -> Result<Option<()>, S::Error>    /// complete.    /// This returns `Ok(Some(()))` when there are more items to serialize, or `Ok(None)` when    ///    /// Serializes a sequence item in the serializer.pub trait SeqVisitor {/// A trait that is used by a `Serialize` to iterate through a sequence.}    }        ""    fn format() -> &'static str {    /// specific field attributes should be used with the serializer.    /// The serializer format is used to determine which format    ///    /// Specify a format string for the serializer.    }        self.visit_struct_elt(key, value)    {        where V: Serialize,                                   value: V) -> Result<(), Self::Error>                                   key: &'static str,    fn visit_struct_variant_elt<V>(&mut self,    #[inline]    /// By default, struct variant elements are serialized as a struct element.    ///    /// Serializes an element of a struct variant.    }        self.visit_struct(variant, visitor)    {        where V: MapVisitor,                               visitor: V) -> Result<(), Self::Error>                               variant: &'static str,                               _variant_index: usize,                               _name: &'static str,    fn visit_struct_variant<V>(&mut self,    #[inline]    /// By default, struct variants are serialized as a struct.    ///    /// Serializes a struct variant.    }        self.visit_map_elt(key, value)    {        where V: Serialize,                           value: V) -> Result<(), Self::Error>                           key: &'static str,    fn visit_struct_elt<V>(&mut self,    #[inline]    /// By default, struct elements are serialized as a map element with the field name as the key.    ///    /// Serializes an element of a struct.    }        self.visit_map(visitor)    {        where V: MapVisitor,                       visitor: V) -> Result<(), Self::Error>                       _name: &'static str,    fn visit_struct<V>(&mut self,    #[inline]    /// By default, structs are serialized as a map with the field name as the key.    ///    /// Serializes a struct.              V: Serialize;        where K: Serialize,    fn visit_map_elt<K, V>(&mut self, key: K, value: V) -> Result<(), Self::Error>    /// Serializes a map element (key-value pair).        where V: MapVisitor;    fn visit_map<V>(&mut self, visitor: V) -> Result<(), Self::Error>aduu	9����ga`<4�����`ZY6.�
�
�
�
E
(
"

����yk�������]O&�
�
�
D
'
!
�	�	�	�	�	�	u	D	     #[i    #[inline]    /// in the tuple. By default, tuples are seri    #[inline]By default, tuples are serialized a    #[inline]    /// By default, tuples are serialized as a sequence.    ///    /// Serializes a tuple element.    }        self.visit_tuple_struct(variant, visitor)    {        where V: SeqVisitor,                              visitor: V) -> Result<(), Self::Error>                              variant: &'static str,                              _variant_index: usize,                              _name: &'static str,    fn visit_tuple_variant<V>(&mut self,    #[inline]    /// By default, tuple variants are serialized as a tuple struct.    ///    /// Serializes a tuple variant.    }        self.visit_tuple_elt(value)    {        where T: Serialize    fn visit_tuple_struct_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    /// By default, tuple struct elements are serialized as a tuple element.    ///    /// Serializes a tuple struct element.    }        self.visit_tuple(visitor)    {        where V: SeqVisitor,                             visitor: V) -> Result<(), Self::Error>                             _name: &'static str,    fn visit_tuple_struct<V>(&mut self,    #[inline]    /// By default, tuple structs are serialized as a tuple.    ///    /// Serializes a tuple struct.    }        self.visit_seq_elt(value)    {        where T: Serialize    fn visit_tuple_elt<T>(&mut self, value: T) -> Result<(), Self::Error>    #[inline]    /// By default, tuples are serialized as a sequence.    ///    /// Serializes a tuple element.    }        self.visit_seq(visitor)    {        where V: SeqVisitor,    fn visit_tuple<V>(&mut self, visitor: V) -> Result<(), Self::Error>    #[inline]