From dec6b6723670cf6ea110db82becb5b128662ca94 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 13 Apr 2017 14:02:13 -0700 Subject: [PATCH] Hyperlink the Serializer associated types --- serde/src/ser/mod.rs | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index 4978703a..d83b729f 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -294,41 +294,58 @@ pub trait Serialize { pub trait Serializer: Sized { /// 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 + /// 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. + /// + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html type Ok; /// The error type when some error occurs during serialization. type Error: Error; - /// Type returned from `serialize_seq` and `serialize_seq_fixed_size` for - /// serializing the content of the sequence. + /// Type returned from [`serialize_seq`] and [`serialize_seq_fixed_size`] + /// for serializing the content of the sequence. + /// + /// [`serialize_seq`]: #tymethod.serialize_seq + /// [`serialize_seq_fixed_size`]: #tymethod.serialize_seq_fixed_size type SerializeSeq: SerializeSeq; - /// Type returned from `serialize_tuple` for serializing the content of the - /// tuple. + /// Type returned from [`serialize_tuple`] for serializing the content of + /// the tuple. + /// + /// [`serialize_tuple`]: #tymethod.serialize_tuple type SerializeTuple: SerializeTuple; - /// Type returned from `serialize_tuple_struct` for serializing the content - /// of the tuple struct. + /// Type returned from [`serialize_tuple_struct`] for serializing the + /// content of the tuple struct. + /// + /// [`serialize_tuple_struct`]: #tymethod.serialize_tuple_struct type SerializeTupleStruct: SerializeTupleStruct; - /// Type returned from `serialize_tuple_variant` for serializing the content - /// of the tuple variant. + /// Type returned from [`serialize_tuple_variant`] for serializing the + /// content of the tuple variant. + /// + /// [`serialize_tuple_variant`]: #tymethod.serialize_tuple_variant type SerializeTupleVariant: SerializeTupleVariant; - /// Type returned from `serialize_map` for serializing the content of the + /// Type returned from [`serialize_map`] for serializing the content of the /// map. + /// + /// [`serialize_map`]: #tymethod.serialize_map type SerializeMap: SerializeMap; - /// Type returned from `serialize_struct` for serializing the content of the - /// struct. + /// Type returned from [`serialize_struct`] for serializing the content of + /// the struct. + /// + /// [`serialize_struct`]: #tymethod.serialize_struct type SerializeStruct: SerializeStruct; - /// Type returned from `serialize_struct_variant` for serializing the + /// Type returned from [`serialize_struct_variant`] for serializing the /// content of the struct variant. + /// + /// [`serialize_struct_variant`]: #tymethod.serialize_struct_variant type SerializeStructVariant: SerializeStructVariant; /// Serialize a `bool` value.