Hyperlink the Serializer associated types
This commit is contained in:
parent
0cf8eadef8
commit
dec6b67236
@ -294,41 +294,58 @@ pub trait Serialize {
|
|||||||
pub trait Serializer: Sized {
|
pub trait Serializer: Sized {
|
||||||
/// The output type produced by this `Serializer` during successful
|
/// The output type produced by this `Serializer` during successful
|
||||||
/// serialization. Most serializers that produce text or binary output
|
/// serialization. Most serializers that produce text or binary output
|
||||||
/// should set `Ok = ()` and serialize into an `io::Write` or buffer
|
/// should set `Ok = ()` and serialize into an [`io::Write`] or buffer
|
||||||
/// contained within the `Serializer` instance. Serializers that build
|
/// contained within the `Serializer` instance. Serializers that build
|
||||||
/// in-memory data structures may be simplified by using `Ok` to propagate
|
/// in-memory data structures may be simplified by using `Ok` to propagate
|
||||||
/// the data structure around.
|
/// the data structure around.
|
||||||
|
///
|
||||||
|
/// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
|
||||||
type Ok;
|
type Ok;
|
||||||
|
|
||||||
/// The error type when some error occurs during serialization.
|
/// The error type when some error occurs during serialization.
|
||||||
type Error: Error;
|
type Error: Error;
|
||||||
|
|
||||||
/// Type returned from `serialize_seq` and `serialize_seq_fixed_size` for
|
/// Type returned from [`serialize_seq`] and [`serialize_seq_fixed_size`]
|
||||||
/// serializing the content of the sequence.
|
/// for serializing the content of the sequence.
|
||||||
|
///
|
||||||
|
/// [`serialize_seq`]: #tymethod.serialize_seq
|
||||||
|
/// [`serialize_seq_fixed_size`]: #tymethod.serialize_seq_fixed_size
|
||||||
type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_tuple` for serializing the content of the
|
/// Type returned from [`serialize_tuple`] for serializing the content of
|
||||||
/// tuple.
|
/// the tuple.
|
||||||
|
///
|
||||||
|
/// [`serialize_tuple`]: #tymethod.serialize_tuple
|
||||||
type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_tuple_struct` for serializing the content
|
/// Type returned from [`serialize_tuple_struct`] for serializing the
|
||||||
/// of the tuple struct.
|
/// content of the tuple struct.
|
||||||
|
///
|
||||||
|
/// [`serialize_tuple_struct`]: #tymethod.serialize_tuple_struct
|
||||||
type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_tuple_variant` for serializing the content
|
/// Type returned from [`serialize_tuple_variant`] for serializing the
|
||||||
/// of the tuple variant.
|
/// content of the tuple variant.
|
||||||
|
///
|
||||||
|
/// [`serialize_tuple_variant`]: #tymethod.serialize_tuple_variant
|
||||||
type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_map` for serializing the content of the
|
/// Type returned from [`serialize_map`] for serializing the content of the
|
||||||
/// map.
|
/// map.
|
||||||
|
///
|
||||||
|
/// [`serialize_map`]: #tymethod.serialize_map
|
||||||
type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_struct` for serializing the content of the
|
/// Type returned from [`serialize_struct`] for serializing the content of
|
||||||
/// struct.
|
/// the struct.
|
||||||
|
///
|
||||||
|
/// [`serialize_struct`]: #tymethod.serialize_struct
|
||||||
type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Type returned from `serialize_struct_variant` for serializing the
|
/// Type returned from [`serialize_struct_variant`] for serializing the
|
||||||
/// content of the struct variant.
|
/// content of the struct variant.
|
||||||
|
///
|
||||||
|
/// [`serialize_struct_variant`]: #tymethod.serialize_struct_variant
|
||||||
type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>;
|
type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>;
|
||||||
|
|
||||||
/// Serialize a `bool` value.
|
/// Serialize a `bool` value.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user