#[non_exhaustive]pub enum SerdeError {
InvalidVariant(&'static str),
InvalidVariantMatcherSyntax(String),
InvalidTag(String),
MissingIdentifier,
Other(String),
UnexpectedTag {
expected: TtlvTag,
actual: TtlvTag,
},
UnexpectedType {
expected: TtlvType,
actual: TtlvType,
},
UnsupportedRustType(&'static str),
}Expand description
Errors while (de)serializing from/to Rust data structures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidVariant(&'static str)
An enum variant name is neither a hexadecimal string value nor valid matcher syntax.
Valid enum variant names must be set using #[serde(rename = "...")] and must either be a hexadecimal string
value such as "0x01ABEF" or must be valid variant matcher syntax such as "if 0xABCDEF==0x123456". See the
crate level documentation for more details.
InvalidVariantMatcherSyntax(String)
An enum variant name is not valid matcher syntax. See the crate level documentation for more details.
InvalidTag(String)
The #[serde(rename = "...")] name assigned to a Rust data type is not a valid TTLV six character hexadecimal
value such as 0x12ABEF.
MissingIdentifier
None of the #[serde(rename = "...")] named fields in the Rust struct being deserialized into matches the TTLV
tag value being deserialized.
Other(String)
A problem occurred during (de)serialization that is not described by one of the other SerdeError enum variants. This primarily occurs when Serde Derive generated code or Serde library code fails internally and does not provide a more specific dedicated error type for the situation at hand.
UnexpectedTag
The TTLV tag value being deserialized does not match the #[serde(rename = "...")] name assigned to any of the
candidate Rust struct members currently being deserialized into. This can happen when the field is not always
present in the data stream and so should be wrapped in Option<...> in the Rust data structure, or when the
order of the fields in the Rust structure does not match the order of the fields in the TTLV Structure.
UnexpectedType
The TTLV type of the value being deserialized does not match the type of the Rust data structure field being deserialized into.
UnsupportedRustType(&'static str)
The TTLV type of the value being deserialized is not supported yet by the deserializer.