Skip to main content

ShapefileError

Enum ShapefileError 

Source
pub enum ShapefileError {
Show 23 variants InvalidHeader { message: String, }, InvalidFileCode { actual: i32, }, InvalidVersion { version: i32, }, UnsupportedShapeType { shape_type: i32, }, InvalidShapeType { shape_type: i32, }, InvalidGeometry { message: String, record: Option<usize>, }, InvalidCoordinates { message: String, position: Option<usize>, }, InvalidBbox { message: String, }, DbfError { message: String, field: Option<String>, record: Option<usize>, }, InvalidDbfHeader { message: String, }, InvalidFieldDescriptor { message: String, field: Option<String>, }, InvalidFieldValue { message: String, field: String, record: usize, }, EncodingError { message: String, code_page: Option<u8>, }, ShxError { message: String, record: Option<usize>, }, RecordMismatch { shp_count: usize, dbf_count: usize, }, MissingFile { file_type: String, }, Io(Error), UnexpectedEof { message: String, }, Validation { message: String, path: Option<String>, }, Topology { message: String, }, OutOfMemory { message: String, }, LimitExceeded { message: String, limit: usize, actual: usize, }, OxiGdal(OxiGdalError),
}
Expand description

Comprehensive error type for Shapefile operations

Variants§

§

InvalidHeader

Invalid Shapefile header

Fields

§message: String

Error message

§

InvalidFileCode

Invalid file code

Fields

§actual: i32

Actual file code encountered

§

InvalidVersion

Invalid version

Fields

§version: i32

The invalid version number

§

UnsupportedShapeType

Unsupported shape type

Fields

§shape_type: i32

The unsupported shape type code

§

InvalidShapeType

Invalid shape type

Fields

§shape_type: i32

The invalid shape type code

§

InvalidGeometry

Invalid geometry

Fields

§message: String

Error message

§record: Option<usize>

Record number (if available)

§

InvalidCoordinates

Invalid coordinates

Fields

§message: String

Error message

§position: Option<usize>

Position in coordinate array (if known)

§

InvalidBbox

Invalid bounding box

Fields

§message: String

Error message

§

DbfError

DBF parsing error

Fields

§message: String

Error message

§field: Option<String>

Field name (if applicable)

§record: Option<usize>

Record number (if applicable)

§

InvalidDbfHeader

Invalid DBF header

Fields

§message: String

Error message

§

InvalidFieldDescriptor

Invalid field descriptor

Fields

§message: String

Error message

§field: Option<String>

Field name (if known)

§

InvalidFieldValue

Invalid field value

Fields

§message: String

Error message

§field: String

Field name

§record: usize

Record number

§

EncodingError

Encoding error

Fields

§message: String

Error message

§code_page: Option<u8>

Code page (if known)

§

ShxError

SHX index error

Fields

§message: String

Error message

§record: Option<usize>

Record number (if applicable)

§

RecordMismatch

Record mismatch between .shp and .dbf

Fields

§shp_count: usize

Number of records in .shp file

§dbf_count: usize

Number of records in .dbf file

§

MissingFile

Missing required file

Fields

§file_type: String

File type (e.g., “.shp”, “.dbf”, “.shx”)

§

Io(Error)

I/O error

§

UnexpectedEof

EOF (End of File) error

Fields

§message: String

Error message

§

Validation

Validation error

Fields

§message: String

Error message

§path: Option<String>

Path to the invalid element

§

Topology

Topology error

Fields

§message: String

Error message

§

OutOfMemory

Out of memory error

Fields

§message: String

Error message

§

LimitExceeded

Limit exceeded

Fields

§message: String

Error message

§limit: usize

The limit that was exceeded

§actual: usize

The actual value

§

OxiGdal(OxiGdalError)

Generic OxiGDAL error

Implementations§

Source§

impl ShapefileError

Source

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

Creates a new invalid header error

Source

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

Creates a new invalid geometry error

Source

pub fn invalid_geometry_at<S: Into<String>>(message: S, record: usize) -> Self

Creates a new invalid geometry error with record number

Source

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

Creates a new invalid coordinates error

Source

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

Creates a new invalid coordinates error with position

Source

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

Creates a new DBF error

Source

pub fn dbf_error_at<S: Into<String>, F: Into<String>>( message: S, field: F, record: usize, ) -> Self

Creates a new DBF error with field and record

Source

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

Creates a new encoding error

Source

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

Creates a new validation error

Source

pub fn validation_at<S: Into<String>, P: Into<String>>( message: S, path: P, ) -> Self

Creates a new validation error with path

Source

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

Creates a new topology error

Source

pub fn limit_exceeded<S: Into<String>>( message: S, limit: usize, actual: usize, ) -> Self

Creates a new limit exceeded error

Source

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

Creates a new unexpected EOF error

Trait Implementations§

Source§

impl Debug for ShapefileError

Source§

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

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

impl Display for ShapefileError

Source§

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

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

impl Error for ShapefileError

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 ShapefileError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<OxiGdalError> for ShapefileError

Source§

fn from(source: OxiGdalError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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.