Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 23 variants InvalidEpsgCode { code: u32, }, EpsgCodeNotFound { code: u32, }, InvalidProjString { reason: String, }, InvalidWkt { reason: String, }, WktParseError { position: usize, message: String, }, TransformationError { reason: String, }, UnsupportedCrs { crs_type: String, }, IncompatibleCrs { src: String, tgt: String, }, InvalidCoordinate { reason: String, }, CoordinateOutOfBounds { x: f64, y: f64, }, InvalidBoundingBox { reason: String, }, MissingParameter { parameter: String, }, InvalidParameter { parameter: String, reason: String, }, DatumTransformError { reason: String, }, ProjectionInitError { reason: String, }, UnsupportedProjection { projection: String, }, NumericalError { operation: String, }, ConvergenceError { iterations: usize, }, JsonError(Error), IoError(Error), Utf8Error(Utf8Error), Proj4rsError(String), Other(String),
}
Expand description

Comprehensive error type for projection operations.

Variants§

§

InvalidEpsgCode

Invalid EPSG code

Fields

§code: u32

The invalid EPSG code

§

EpsgCodeNotFound

EPSG code not found in database

Fields

§code: u32

The EPSG code that was not found

§

InvalidProjString

Invalid PROJ string

Fields

§reason: String

Reason for the invalid PROJ string

§

InvalidWkt

Invalid WKT (Well-Known Text) string

Fields

§reason: String

Reason for the invalid WKT

§

WktParseError

WKT parsing error

Fields

§position: usize

Position in the WKT string where error occurred

§message: String

Error message

§

TransformationError

Coordinate transformation error

Fields

§reason: String

Reason for transformation failure

§

UnsupportedCrs

Unsupported CRS (Coordinate Reference System)

Fields

§crs_type: String

Type of CRS that is not supported

§

IncompatibleCrs

Incompatible source and target CRS

Fields

§src: String

Source CRS description

§tgt: String

Target CRS description

§

InvalidCoordinate

Invalid coordinate

Fields

§reason: String

Reason for invalid coordinate

§

CoordinateOutOfBounds

Out of bounds coordinate

Fields

§x: f64

X coordinate

§y: f64

Y coordinate

§

InvalidBoundingBox

Invalid bounding box

Fields

§reason: String

Reason for invalid bounding box

§

MissingParameter

Missing required parameter

Fields

§parameter: String

Name of missing parameter

§

InvalidParameter

Invalid parameter value

Fields

§parameter: String

Parameter name

§reason: String

Reason for invalid value

§

DatumTransformError

Datum transformation error

Fields

§reason: String

Reason for datum transformation failure

§

ProjectionInitError

Projection initialization error

Fields

§reason: String

Reason for initialization failure

§

UnsupportedProjection

Unsupported projection

Fields

§projection: String

Name of unsupported projection

§

NumericalError

Numerical error (e.g., division by zero, sqrt of negative)

Fields

§operation: String

Operation that caused the error

§

ConvergenceError

Convergence failure in iterative algorithms

Fields

§iterations: usize

Number of iterations attempted

§

JsonError(Error)

JSON serialization/deserialization error

§

IoError(Error)

I/O error

§

Utf8Error(Utf8Error)

UTF-8 conversion error

§

Proj4rsError(String)

Error from proj4rs library

§

Other(String)

Generic error for cases not covered by specific error types

Implementations§

Source§

impl Error

Source

pub fn invalid_epsg_code(code: u32) -> Self

Creates an invalid EPSG code error.

Source

pub fn epsg_not_found(code: u32) -> Self

Creates an EPSG code not found error.

Source

pub fn invalid_proj_string<S: Into<String>>(reason: S) -> Self

Creates an invalid PROJ string error.

Source

pub fn invalid_wkt<S: Into<String>>(reason: S) -> Self

Creates an invalid WKT error.

Source

pub fn wkt_parse_error<S: Into<String>>(position: usize, message: S) -> Self

Creates a WKT parsing error.

Source

pub fn transformation_error<S: Into<String>>(reason: S) -> Self

Creates a transformation error.

Source

pub fn unsupported_crs<S: Into<String>>(crs_type: S) -> Self

Creates an unsupported CRS error.

Source

pub fn incompatible_crs<S: Into<String>>(src: S, tgt: S) -> Self

Creates an incompatible CRS error.

Source

pub fn invalid_coordinate<S: Into<String>>(reason: S) -> Self

Creates an invalid coordinate error.

Source

pub fn coordinate_out_of_bounds(x: f64, y: f64) -> Self

Creates a coordinate out of bounds error.

Source

pub fn invalid_bounding_box<S: Into<String>>(reason: S) -> Self

Creates an invalid bounding box error.

Source

pub fn missing_parameter<S: Into<String>>(parameter: S) -> Self

Creates a missing parameter error.

Source

pub fn invalid_parameter<S: Into<String>>(parameter: S, reason: S) -> Self

Creates an invalid parameter error.

Source

pub fn datum_transform_error<S: Into<String>>(reason: S) -> Self

Creates a datum transform error.

Source

pub fn projection_init_error<S: Into<String>>(reason: S) -> Self

Creates a projection initialization error.

Source

pub fn unsupported_projection<S: Into<String>>(projection: S) -> Self

Creates an unsupported projection error.

Source

pub fn numerical_error<S: Into<String>>(operation: S) -> Self

Creates a numerical error.

Source

pub fn convergence_error(iterations: usize) -> Self

Creates a convergence error.

Source

pub fn from_proj4rs<S: Into<String>>(message: S) -> Self

Creates an error from proj4rs library.

Source

pub fn other<S: Into<String>>(message: S) -> Self

Creates a generic other error.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Available on crate feature std only.
Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.