#[non_exhaustive]pub enum Geometry {
Point(Coord),
LineString(LineString),
Polygon(Polygon),
MultiPoint(Vec<Coord>),
MultiLineString(Vec<LineString>),
MultiPolygon(Vec<Polygon>),
GeometryCollection(Vec<Geometry>),
Empty(GeometryType),
}Expand description
The geometry tree. Marked #[non_exhaustive] so future SemVer-minor
releases can add variants (curves, surfaces, Z/M-bearing variants once
the IR grows past 2D).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Point(Coord)
LineString(LineString)
Polygon(Polygon)
MultiPoint(Vec<Coord>)
MultiLineString(Vec<LineString>)
MultiPolygon(Vec<Polygon>)
GeometryCollection(Vec<Geometry>)
Empty(GeometryType)
A typed-empty geometry (e.g. POINT EMPTY, POLYGON EMPTY). The tag
is preserved so WKB serialization round-trips correctly.
Implementations§
Source§impl Geometry
impl Geometry
pub fn type_of(&self) -> GeometryType
pub fn is_empty(&self) -> bool
Source§impl Geometry
impl Geometry
Sourcepub fn from_wkb(bytes: &[u8]) -> Result<Self>
pub fn from_wkb(bytes: &[u8]) -> Result<Self>
Decode OGC Simple Features WKB bytes into a Geometry.
Accepts both little-endian and big-endian, and respects per-nested byte-order bytes inside collections (the ISO WKB rule).
v0.1 returns Error::Unsupported for Z/M variants — the type code
is recognized but ordinates beyond X/Y are not decoded.
Trait Implementations§
impl StructuralPartialEq for Geometry
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnsafeUnpin for Geometry
impl UnwindSafe for Geometry
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