pub enum Error {
NonFiniteCoordinate(&'static str),
TooFewElements {
geometry: &'static str,
minimum: usize,
spec: Option<&'static str>,
id: Option<Id>,
message: Option<String>,
},
WrongElementCount(&'static str),
EmptyCollection(&'static str),
IdenticalPositions,
AdjacentDuplicatePositions,
RepeatedClosingVertex,
InvalidEnvelopeBounds(&'static str),
TriangulationFailed(&'static str),
}Expand description
Errors returned by egml-core operations.
Variants§
NonFiniteCoordinate(&'static str)
Returned when a floating-point coordinate is not finite (NaN or ±infinity).
The inner string names the offending coordinate component: "x", "y", or "z".
GML requires all coordinate values in a DirectPosition to be real numbers
(ISO 19136 §9.4 DirectPositionType).
TooFewElements
Returned when a collection has fewer elements than the minimum required by the GML geometry constraint.
The inner string is a human-readable description of the violated constraint,
e.g. "LinearRing requires at least 3 positions (ISO 19136 §10.5.12)".
Fields
WrongElementCount(&'static str)
Returned when a collection contains a number of elements that is not
accepted by the operation (e.g. a Triangle not given exactly 3 points).
The inner string describes which collection or argument was invalid.
EmptyCollection(&'static str)
Returned when an operation requires a non-empty input but received an empty one.
The inner string names the offending parameter or context (e.g. "solid",
"multi curve").
IdenticalPositions
Returned when a geometry contains two identical positions where all positions
must be distinct (e.g. all three vertices of a Triangle
must be different, per ISO 19136 §10.5.9).
AdjacentDuplicatePositions
Returned when adjacent positions in a sequence are equal and the geometry type requires all consecutive positions to differ.
Applies to LinearRing
(ISO 19136 §10.5.12) and LineString
(ISO 19136 §10.4.4).
RepeatedClosingVertex
Returned when the first and last position of a ring are equal.
A gml:LinearRing is implicitly closed: the geometry engine connects the
last position back to the first automatically. An explicit repeated closing
vertex is therefore redundant and invalid (ISO 19136 §10.5.12).
InvalidEnvelopeBounds(&'static str)
Returned when an Envelope is constructed
with a lower corner that is strictly greater than the upper corner in one or
more coordinate components.
The inner string names the offending component ("x", "y", or "z").
ISO 19136 §10.1.4 requires lowerCorner ≤ upperCorner in every component.
TriangulationFailed(&'static str)
Returned when the earcut polygon triangulation algorithm produces no triangles.
The inner string provides additional context about the failure (e.g. which polygon or patch could not be decomposed).
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 Eq for Error
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
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.