#[non_exhaustive]pub enum Error {
Show 20 variants
NonFiniteCoordinate {
axis: &'static str,
value: f64,
},
TooFewElements {
geometry: &'static str,
minimum: usize,
spec: Option<&'static str>,
id: Option<Id>,
detail: Option<String>,
},
InvalidElementCount {
geometry: &'static str,
expected: usize,
actual: usize,
spec: Option<&'static str>,
},
IdenticalPositions {
first: DirectPosition,
second: DirectPosition,
},
AdjacentDuplicatePositions {
index: usize,
position: DirectPosition,
},
RepeatedClosingVertex {
position: DirectPosition,
},
InvalidEnvelopeBounds {
axis: &'static str,
lower: f64,
upper: f64,
},
NotSurfaceOrVolume {
non_zero_extents: u8,
},
NotASurface {
non_zero_extents: u8,
},
NotAVolume {
non_zero_extents: u8,
},
EmptyId,
TriangulationFailed {
context: String,
},
MissingExteriorRing,
UnresolvedRingReference {
href: Option<String>,
},
UnresolvedSurfaceReference {
href: Option<String>,
},
UnresolvedCurveReference {
href: Option<String>,
},
MissingExteriorShell,
UnresolvedShellReference {
href: Option<String>,
},
TriangulationNotSupported {
geometry: &'static str,
},
InvalidAttributeValue {
attribute: &'static str,
value: String,
},
}Expand description
Errors returned by egml-core operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NonFiniteCoordinate
Returned when a floating-point coordinate is not finite (NaN or ±infinity).
axis names the offending component ("x", "y", or "z"); value is
the actual non-finite number that was supplied.
TooFewElements
Returned when a collection has fewer elements than the minimum required by the GML geometry constraint.
Optional fields carry progressively more context: spec cites the ISO
clause, id names the offending GML object, and detail gives a
human-readable description of the actual content that was supplied.
Fields
InvalidElementCount
Returned when a collection has a number of elements other than the exact count required by the GML geometry constraint.
expected is the required count; actual is what was supplied.
spec optionally cites the ISO/OGC clause that mandates the count.
IdenticalPositions
Returned when two positions that must be distinct are identical.
Applies to Triangle
vertices (OGC 07-036 §10.5.12.5).
AdjacentDuplicatePositions
Returned when adjacent positions in a sequence are equal.
index is the zero-based index of the first position in the duplicate
pair; position is its value. Applies to
LinearRing
(OGC 07-036 §10.5.8) and
LineString
(OGC 07-036 §10.4.4).
RepeatedClosingVertex
Returned when the first and last position of a ring are equal.
position is the repeated vertex. A gml:LinearRing is implicitly
closed and must not include an explicit closing vertex (OGC 07-036 §10.5.8).
Fields
position: DirectPositionInvalidEnvelopeBounds
Returned when an Envelope is constructed
with a lower corner that strictly exceeds the upper corner along axis.
lower and upper are the actual conflicting coordinate values.
OGC 07-036 §10.1.4.6 requires lowerCorner ≤ upperCorner in every component.
NotSurfaceOrVolume
Returned when
Envelope::to_triangulated_surface
is called on an envelope that is neither a surface nor a volume.
non_zero_extents is the number of axes with non-zero extent (0 or 1).
NotASurface
Returned when Envelope::to_polygon
is called on an envelope that does not have exactly two non-zero extents.
non_zero_extents is the actual number of axes with non-zero extent.
NotAVolume
Returned when Envelope::to_solid
is called on an envelope that does not have all three extents non-zero.
non_zero_extents is the actual number of axes with non-zero extent.
EmptyId
Returned when an empty string is used to construct a Id.
TriangulationFailed
Returned when the earcut polygon triangulation algorithm produces no triangles.
context provides additional information about which polygon or patch
could not be decomposed.
MissingExteriorRing
Returned when an operation requires an exterior ring but the polygon has none.
UnresolvedRingReference
Returned when a ring property carries only an xlink:href reference and the referenced geometry object has not been resolved into an inline object.
href is the reference value if one was present, or None if the property
has neither an inline object nor a reference.
UnresolvedSurfaceReference
Returned when a surface property carries only an xlink:href reference and the referenced geometry object has not been resolved into an inline object.
href is the reference value if one was present, or None if the property
has neither an inline object nor a reference.
UnresolvedCurveReference
Returned when a curve property carries only an xlink:href reference and the referenced geometry object has not been resolved into an inline object.
href is the reference value if one was present, or None if the property
has neither an inline object nor a reference.
MissingExteriorShell
Returned when an operation requires an exterior shell but the solid has none.
UnresolvedShellReference
Returned when a shell property carries only an xlink:href reference and the referenced geometry object has not been resolved into an inline object.
href is the reference value if one was present, or None if the property
has neither an inline object nor a reference.
TriangulationNotSupported
Returned when triangulate is called on a geometry type that cannot
produce a surface (e.g. Point, MultiCurve).
geometry names the concrete variant that was encountered.
InvalidAttributeValue
Returned when an attribute held a value that could not be parsed into
its expected type (e.g. an xlink:show/xlink:actuate value outside
the enumeration defined by the XLink specification).
attribute names the attribute (e.g. "xlink:show"); value is the
raw string that was supplied.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.