Link to more complete explanation of the data model

This commit is contained in:
David Tolnay
2018-05-27 14:11:02 -07:00
parent 0fbf4d0c5d
commit a65950acca
2 changed files with 12 additions and 8 deletions
+6 -4
View File
@@ -787,10 +787,10 @@ where
/// A **data format** that can deserialize any data structure supported by /// A **data format** that can deserialize any data structure supported by
/// Serde. /// Serde.
/// ///
/// The role of this trait is to define the deserialization half of the 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 /// data model], which is a way to categorize every Rust data type into one of
/// possible types. Each method of the `Serializer` trait corresponds to one of /// 29 possible types. Each method of the `Serializer` trait corresponds to one
/// the types of the data model. /// of the types of the data model.
/// ///
/// Implementations of `Deserialize` map themselves into this data model by /// Implementations of `Deserialize` map themselves into this data model by
/// passing to the `Deserializer` a `Visitor` implementation that can receive /// 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 /// means your data type will be able to deserialize from self-describing
/// formats only, ruling out Bincode and many others. /// formats only, ruling out Bincode and many others.
/// ///
/// [Serde data model]: https://serde.rs/data-model.html
///
/// # Lifetime /// # Lifetime
/// ///
/// The `'de` lifetime of this trait is the lifetime of data that may be /// The `'de` lifetime of this trait is the lifetime of data that may be
+6 -4
View File
@@ -251,10 +251,10 @@ pub trait Serialize {
/// A **data format** that can serialize any data structure supported by Serde. /// 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 /// The role of this trait is to define the serialization half of the [Serde
/// model, which is a way to categorize every Rust data structure into one of 29 /// data model], which is a way to categorize every Rust data structure into one
/// possible types. Each method of the `Serializer` trait corresponds to one of /// of 29 possible types. Each method of the `Serializer` trait corresponds to
/// the types of the data model. /// one of the types of the data model.
/// ///
/// Implementations of `Serialize` map themselves into this data model by /// Implementations of `Serialize` map themselves into this data model by
/// invoking exactly one of the `Serializer` methods. /// 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 /// serializer) that produces a `serde_json::Value` data structure in memory as
/// output. /// output.
/// ///
/// [Serde data model]: https://serde.rs/data-model.html
///
/// # Example implementation /// # Example implementation
/// ///
/// The [example data format] presented on the website contains example code for /// The [example data format] presented on the website contains example code for