#[non_exhaustive]pub enum Error {
Shape {
topology: &'static str,
wanted: &'static str,
},
Unsupported {
form: &'static str,
at: String,
},
Unbounded {
form: &'static str,
at: String,
states: &'static str,
},
Malformed {
at: String,
message: String,
},
Missing(String),
Storage(Error),
Core(Error),
Domain(Error),
}Expand description
Something that stopped a representation from becoming points.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Shape
A shape the caller asked for that this object cannot take.
Not a gap in this build: the file states no connection the answer could be derived from. Names both ends, because whoever asked wrote a rule and needs to know which of their rules met which object.
Fields
Unsupported
A form of array this crate does not evaluate yet.
Named, never silent. The alternative - returning no points - looks exactly like a working program with an empty file, and that is the failure mode this crate exists to avoid.
Fields
Unbounded
The file states a shape with no extent of its own.
Different news from Error::Unsupported, and the difference is one a
caller acts on. Unsupported means this build does not evaluate that
form yet, so waiting is a strategy. This means the file never says
how far the shape goes: a HorizontalPlaneGeometry is one number, a
depth, and a plane is infinite. No release will add the extent, because
it is not a fact about the model - it is a decision about the picture,
and it belongs to whoever is drawing.
So the refusal names what is missing rather than pretending to a gap, and a viewer can offer the one thing that works: an extent of its own. Drawing some box instead would put a surface of invented size into a model, which is the failure this crate exists to avoid.
Fields
Malformed
The object is not shaped the way its schema says.
Missing(String)
The referenced object is not in the store.
Storage(Error)
Reading an external array failed.
Core(Error)
Reading or walking an object failed.
Domain(Error)
A unit, a coordinate system or a reprojection could not be read.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_missing_file(&self) -> bool
pub fn is_missing_file(&self) -> bool
Whether this is “the external file is not there”.
A package whose .h5 companion was not shipped is a gap in what the
caller was given, not a defect in the model - and a viewer says so
differently from “this build cannot evaluate that form”.
Sourcepub fn shape(topology: &'static str, wanted: &'static str) -> Self
pub fn shape(topology: &'static str, wanted: &'static str) -> Self
A shape the caller asked for that this object cannot take.
Separate from Error::Unsupported on purpose, and the distinction is
the whole message: that one means this build does not do it yet, and
invites a future version. This one means the file does not say enough
for anyone to do it - a set of polylines is not a surface in any build.
Sourcepub fn unsupported(form: &'static str, at: impl Display) -> Self
pub fn unsupported(form: &'static str, at: impl Display) -> Self
A form this crate meets but does not evaluate.
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()