Skip to content

Commit

Permalink
Better document SeqAccessDeserializer and MapAccessDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed May 7, 2023
1 parent 8a4d271 commit 0b57b49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions serde/src/de/value.rs
Expand Up @@ -1045,6 +1045,12 @@ where
////////////////////////////////////////////////////////////////////////////////

/// A deserializer holding a `SeqAccess`.
///
/// This deserializer will call [`Visitor::visit_seq`] for all requests except
/// for [`Deserializer::deserialize_enum`]. In the latest case the enum will be
/// deserialized from the first two elements of a sequence. The first element
/// would be interpreted as a variant name and the second as a content of
/// a variant. In case of unit variant the second element is optional.
#[derive(Clone, Debug)]
pub struct SeqAccessDeserializer<A> {
seq: A,
Expand Down Expand Up @@ -1479,6 +1485,12 @@ where
////////////////////////////////////////////////////////////////////////////////

/// A deserializer holding a `MapAccess`.
///
/// This deserializer will call [`Visitor::visit_map`] for all requests except
/// for [`Deserializer::deserialize_enum`]. In the latest case the enum will be
/// deserialized from the first entry of a map. The map key would be interpreted
/// as a variant name and the map value would be interpreted as a content of
/// a variant.
#[derive(Clone, Debug)]
pub struct MapAccessDeserializer<A> {
map: A,
Expand Down

0 comments on commit 0b57b49

Please sign in to comment.