pub enum WktError {
UnexpectedChar {
pos: usize,
ch: char,
},
UnexpectedToken {
expected: &'static str,
found: String,
},
UnexpectedEof,
InvalidNumber(String),
UnknownGeometryType(String),
TypeMismatch {
expected: &'static str,
found: &'static str,
},
NestingTooDeep,
}Expand description
Everything that can go wrong reading WKT.
Covers the lexer’s character-level failures plus the parser’s
token-level and type-level failures, so a single error type flows
through the whole read path (mirroring how
boost/geometry/io/wkt/read.hpp throws a single
read_wkt_exception).
Variants§
UnexpectedChar
A character that cannot begin any lexeme, at byte offset pos.
Fields
UnexpectedToken
A token that does not fit the grammar at this point.
Fields
UnexpectedEof
Input ended while the parser still needed more tokens.
InvalidNumber(String)
A numeric lexeme that failed to parse as f64.
UnknownGeometryType(String)
A leading keyword that is not a known OGC geometry type.
TypeMismatch
A typed-parse convenience function was handed WKT of the wrong
kind (e.g. crate::parse_point on a LINESTRING).
Fields
NestingTooDeep
Nested GEOMETRYCOLLECTIONs exceeded the reader’s recursion limit.
Rejecting deep nesting keeps a hostile string from overflowing the
native stack (an uncatchable process abort).
Trait Implementations§
Source§impl Error for WktError
Available on crate feature std only.
impl Error for WktError
std only.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()