From a65950accaa97097ba7e19f88c4bb1eedc64b918 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 27 May 2018 14:11:02 -0700 Subject: [PATCH] Link to more complete explanation of the data model --- serde/src/de/mod.rs | 10 ++++++---- serde/src/ser/mod.rs | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index 684c937d..d09c7350 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -787,10 +787,10 @@ where /// A **data format** that can deserialize any data structure supported by /// Serde. /// -/// The role of this trait is to define the deserialization half of the Serde -/// data model, which is a way to categorize every Rust data type into one of 29 -/// possible types. Each method of the `Serializer` trait corresponds to one of -/// the types of the data model. +/// The role of this trait is to define the deserialization half of the [Serde +/// data model], which is a way to categorize every Rust data type into one of +/// 29 possible types. Each method of the `Serializer` trait corresponds to one +/// of the types of the data model. /// /// Implementations of `Deserialize` map themselves into this data model by /// passing to the `Deserializer` a `Visitor` implementation that can receive @@ -873,6 +873,8 @@ where /// means your data type will be able to deserialize from self-describing /// formats only, ruling out Bincode and many others. /// +/// [Serde data model]: https://serde.rs/data-model.html +/// /// # Lifetime /// /// The `'de` lifetime of this trait is the lifetime of data that may be diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index 34c8be9b..1dbb11a5 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -251,10 +251,10 @@ pub trait Serialize { /// A **data format** that can serialize any data structure supported by Serde. /// -/// The role of this trait is to define the serialization half of the Serde data -/// model, which is a way to categorize every Rust data structure into one of 29 -/// possible types. Each method of the `Serializer` trait corresponds to one of -/// the types of the data model. +/// The role of this trait is to define the serialization half of the [Serde +/// data model], which is a way to categorize every Rust data structure into one +/// of 29 possible types. Each method of the `Serializer` trait corresponds to +/// one of the types of the data model. /// /// Implementations of `Serialize` map themselves into this data model by /// invoking exactly one of the `Serializer` methods. @@ -317,6 +317,8 @@ pub trait Serialize { /// serializer) that produces a `serde_json::Value` data structure in memory as /// output. /// +/// [Serde data model]: https://serde.rs/data-model.html +/// /// # Example implementation /// /// The [example data format] presented on the website contains example code for