#[non_exhaustive]pub enum Error {
Io(Error),
#[non_exhaustive] InvalidPlist {
format: &'static str,
source: Option<Box<dyn Error + Send + Sync>>,
},
#[non_exhaustive] Parse {
format: &'static str,
source: Option<Box<dyn Error + Send + Sync>>,
},
UnknownType(&'static str),
#[non_exhaustive] TypeMismatch {
expected: &'static str,
found: &'static str,
},
MaxDepthExceeded,
ParseScalar(String),
NoRootElement,
NullNotRepresentable,
Message(String),
#[non_exhaustive] FeatureDisabled {
format: Format,
},
}Expand description
Errors returned while encoding or decoding a property list.
The enum and its struct-like variants are #[non_exhaustive], so new
variants and fields are not breaking changes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
An underlying reader or writer failed.
#[non_exhaustive]InvalidPlist
The input is not recognizable as a property list of format.
This is the only variant that makes the decode ladder fall back from the XML parser to the text parser.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Parse
The input was recognized as format but failed to parse. Never
triggers the XML-to-text fallback.
Fields
This variant is marked as non-exhaustive
UnknownType(&'static str)
A value of this type cannot be represented in a property list.
#[non_exhaustive]TypeMismatch
A property-list value cannot decode into the requested target type.
Fields
This variant is marked as non-exhaustive
MaxDepthExceeded
Nesting exceeded MAX_PARSE_DEPTH while
parsing — the input is too deeply nested to process safely.
ParseScalar(String)
A scalar literal failed to parse (integer, real, boolean, or date).
NoRootElement
Encoding produced no root element to write.
NullNotRepresentable
A null value reached a position where property lists cannot express it.
Message(String)
A free-form message, used by serde Error::custom and similar.
#[non_exhaustive]FeatureDisabled
The requested output format is behind a cargo feature that is not enabled in this build.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl Error for Error
Available on crate feature serde only.
impl Error for Error
serde only.Source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.