fn deserialize_struct<V>(
        mut self,
        _name: &'static str,
        _fields: &'static [&'static str],
        visitor: V,
    ) -> Result<V::Value>
    where
        V: Visitor<'de>,
    {
        let _tag = self.read_tag()?;
        // assert_eq!(tag, self.tag, "tag missmatch {} vs {}", tag, self.tag);

        // read len
        let len = self.read_len()?;

        // calculate actual payload len
        let payload_len = len - TLV_HEADER_SIZE;

        let value = visitor.visit_seq(BytesReader::new(&mut self, payload_len))?;

        Ok(value)
    }
// Structs look just like maps in JSON.
//
// Notice the `fields` parameter - a "struct" in the Serde data model means
// that the `Deserialize` implementation is required to know what the fields
// are before even looking at the input data. Any key-value pairing in which
// the fields cannot be known ahead of time is probably a map.
Structs look just like maps in JSON.
Notice the `fields` parameter - a "struct" in the Serde data model means
that the `Deserialize` implementation is required to know what the fields
are before even looking at the input data. Any key-value pairing in which
the fields cannot be known ahead of time is probably a map.
Structs look just like maps in JSON . Notice the ` fields ` parameter - a " struct " in the Serde data model means that the ` Deserialize ` implementation is required to know what the fields are before even looking at the input data . Any key - value pairing in which the fields cannot be known ahead of time is probably a map .
fn deserialize_struct<V>(
        mut self,
        _name: &'static str,
        _fields: &'static [&'static str],
        visitor: V,
    ) -> Result<V::Value>
    where
        V: Visitor<'de>,
    {
        let _tag = self.read_tag()?;
        // assert_eq!(tag, self.tag, "tag missmatch {} vs {}", tag, self.tag);
        // read len
        let len = self.read_len()?;
        // calculate actual payload len
        let payload_len = len - TLV_HEADER_SIZE;
        let value = visitor.visit_seq(BytesReader::new(&mut self, payload_len))?;
        Ok(value)
    }
fn deserialize_struct < V > ( mut self , _name : & ' static str , _fields : & ' static [ & ' static str ] , visitor : V , ) -> Result < V :: Value > where V : Visitor < ' de > , { let _tag = self . read_tag ( ) ? ; // assert_eq!(tag, self.tag, "tag missmatch {} vs {}", tag, self.tag); // read len let len = self . read_len ( ) ? ; // calculate actual payload len let payload_len = len - TLV_HEADER_SIZE ; let value = visitor . visit_seq ( BytesReader :: new ( & mut self , payload_len ) ) ? ; Ok ( value ) }
Structs look just like maps in JSON.
Structs look just like maps in JSON .
mut self
_name
&'static str
_fields
&'static [&'static str]
visitor
V
mut self
_name
&'static str
_fields
&'static [&'static str]
visitor
V