#[non_exhaustive]pub enum Error {
Io(Error),
Xml(String),
NotCimXml(String),
DanglingReference {
object: String,
attribute: &'static str,
target: String,
total: usize,
},
SchemaMismatch {
left: &'static str,
right: &'static str,
},
UnknownVintage {
path: String,
known: Vec<&'static str>,
},
Zip(String),
InputTooLarge {
limit: u64,
read: u64,
source: Option<String>,
},
}Expand description
A hard failure: the operation could not be completed.
Problems that leave the data usable — an unknown class, an unresolved reference in
lenient mode — are reported as Diagnostics instead, so that reading a
non-conforming file still yields a model plus a precise report.
#[non_exhaustive]: a new CIM vintage or a new input syntax is a regeneration away, and
a variant added for one should not be a breaking change for everyone. Match with a
wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Xml(String)
The document is not well-formed XML.
NotCimXml(String)
The document is well-formed XML but not a CIM/XML document.
DanglingReference
A reference could not be resolved and the link policy is strict.
Fields
SchemaMismatch
Two models built from different CIM vintages cannot be combined.
Class and attribute identifiers are indices into one vintage’s tables, so the same
number means different things in two of them. Combining the models regardless would
not fail loudly — it would silently file ACLineSegment.r under whatever the other
vintage happens to put at that index.
UnknownVintage
No file under the given path declares a CIM vocabulary this build recognises.
Either the input is not CIM/XML, or it is a vintage this build has no feature for.
Zip(String)
A zip archive could not be read.
InputTooLarge
The input exceeded ReadOptions::max_input_bytes.
The budget covers one load call — every file and every decompressed archive entry of it — so a small archive that inflates without bound stops here rather than at the host’s memory limit. Unlike a damaged file this is never downgraded to a diagnostic by lenient reading: the model is incomplete, and a load that returned it would look like a success. Discard the dataset.
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()