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 Jul 27, 2024
1 parent 7d4703b commit f4e0b77
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions serde/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,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 @@ -1487,6 +1493,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 f4e0b77

Please sign in to comment.