pub enum Token {
Ident(String),
Number(f64),
LeftParen,
RightParen,
Comma,
Empty,
Eof,
}Expand description
One lexeme of a WKT string.
Mirrors the token classes the boost::tokenizer in
boost/geometry/io/wkt/read.hpp separates on: a keyword/identifier,
a number, the three punctuation marks, and end-of-input. EMPTY is
broken out as its own token (rather than folded into Ident) so the
parser can branch on <TYPE> EMPTY without re-comparing strings.
Variants§
Ident(String)
An uppercased keyword — a geometry type (POINT, LINESTRING,
…) or an OGC dimension suffix (Z, M, ZM).
Number(f64)
A numeric literal, already parsed to f64 (signed, decimal,
E-notation).
LeftParen
(
RightParen
)
Comma
,
Empty
The EMPTY keyword.
Eof
End of input.
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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
Mutably borrows from an owned value. Read more