#[non_exhaustive]pub enum Error {
Show 13 variants
Xml(String),
Io(Error),
Eof,
UnexpectedElement {
expected: String,
found: String,
},
MissingRequired {
kind: &'static str,
name: String,
parent: String,
},
ParseValue {
value: String,
ty: &'static str,
reason: String,
},
UnknownXsiType {
value: String,
ty: &'static str,
},
UnknownField {
ty: &'static str,
field: String,
},
InvalidPath {
path: String,
reason: String,
},
TypeMismatch {
path: String,
expected: String,
found: String,
},
UnknownType(String),
VersionAbsent(String),
Other(String),
}Expand description
Everything that can go wrong while reading, writing or reflecting over an EnergyML object.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Xml(String)
Low level XML failure reported by the parser or writer.
Io(Error)
I/O failure while reading or writing.
Eof
The document ended while a value was still being read.
UnexpectedElement
An element was found where another one was required.
Fields
MissingRequired
A mandatory attribute or child element was absent.
Fields
ParseValue
A lexical value could not be converted to its Rust type.
Fields
UnknownXsiType
An xsi:type (or substituted element name) did not match any known
concrete subtype of the expected abstract type.
Fields
UnknownField
Reflection was asked for a field the type does not declare.
InvalidPath
A dotted path could not be parsed.
TypeMismatch
A value of the wrong shape was supplied to a reflective setter.
Fields
UnknownType(String)
The registry does not know the requested type.
VersionAbsent(String)
The requested type belongs to a schema version the project knows but
this build does not carry (see Registry::declare_absent). A refusal
with its reason, not an unknown name: the data may be perfectly good.
The message is the whole story and says what would bring the version.
Other(String)
Catch-all for anything not worth its own variant.
Implementations§
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()