pub enum PolylineError {
InvalidCharacter {
character: char,
position: usize,
},
TruncatedData,
CoordinateOverflow,
InvalidPrecision(u8),
EmptyInput,
InvalidCoordinate(String),
}Expand description
Errors that can occur during polyline encoding or decoding operations.
These errors provide detailed information about what went wrong during polyline processing, including specific locations for parsing errors and descriptive messages for coordinate validation failures.
Variants§
InvalidCharacter
Invalid character found in polyline string.
Polyline strings must contain only ASCII characters in the range 63-126 (‘?’ to ‘~’). This error includes the invalid character and its position in the string.
TruncatedData
Truncated or malformed polyline data.
Occurs when the polyline string ends unexpectedly, such as having a latitude delta without a corresponding longitude delta, or when the variable-length encoding is incomplete.
CoordinateOverflow
Coordinate value overflow during encoding or decoding.
Happens when coordinate calculations exceed the range of 64-bit integers, typically with very high precision values or extreme coordinate differences.
InvalidPrecision(u8)
Invalid precision value.
Precision must be between 1 and 11 inclusive. Higher precision values provide more accuracy but may cause overflow with large coordinate values.
EmptyInput
Empty input where coordinates were expected.
Currently unused - empty inputs are handled gracefully by returning empty results rather than errors.
InvalidCoordinate(String)
Invalid coordinate value.
Occurs when coordinates are NaN, infinite, or outside reasonable geographic bounds (±180° longitude, ±90° latitude).
Trait Implementations§
Source§impl Clone for PolylineError
impl Clone for PolylineError
Source§fn clone(&self) -> PolylineError
fn clone(&self) -> PolylineError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolylineError
impl Debug for PolylineError
Source§impl Display for PolylineError
impl Display for PolylineError
Source§impl Error for PolylineError
impl Error for PolylineError
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()
Source§impl PartialEq for PolylineError
impl PartialEq for PolylineError
Source§fn eq(&self, other: &PolylineError) -> bool
fn eq(&self, other: &PolylineError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PolylineError
Auto Trait Implementations§
impl Freeze for PolylineError
impl RefUnwindSafe for PolylineError
impl Send for PolylineError
impl Sync for PolylineError
impl Unpin for PolylineError
impl UnsafeUnpin for PolylineError
impl UnwindSafe for PolylineError
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> 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 more