pub enum G {
Null,
Point(Point),
Line(Line),
Polygon(Polygon),
Points(Points),
Lines(Lines),
Polygons(Polygons),
Vec(Geometries),
BBox(BBox),
}Expand description
Geometry type variants handled by this library.
Variants§
Null
Undefined geometry.
Point(Point)
Point geometry.
Line(Line)
Line geometry.
Polygon(Polygon)
Polygon geometry.
Points(Points)
Point collection.
Lines(Lines)
Line collection.
Polygons(Polygons)
Polygon collection.
Vec(Geometries)
Mixed collection excluding BBOX.
BBox(BBox)
Bounding box geometry.
Implementations§
Source§impl G
impl G
Sourcepub fn as_polygon(&self) -> Option<&Polygon>
pub fn as_polygon(&self) -> Option<&Polygon>
Return this if it was indeed a Polygon, None otherwise.
Sourcepub fn as_points(&self) -> Option<&Points>
pub fn as_points(&self) -> Option<&Points>
Return this if it was indeed a Point collection, None otherwise.
Sourcepub fn as_lines(&self) -> Option<&Lines>
pub fn as_lines(&self) -> Option<&Lines>
Return this if it was indeed a Line collection, None otherwise.
Sourcepub fn as_polygons(&self) -> Option<&Polygons>
pub fn as_polygons(&self) -> Option<&Polygons>
Return this if it was indeed a Polygon collection, None otherwise.
Trait Implementations§
Source§impl<'r> Decode<'r, Postgres> for G
impl<'r> Decode<'r, Postgres> for G
Source§fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError>
Decode a new value of this type using a raw value from the database.
Source§impl GTrait for G
impl GTrait for G
Source§fn to_wkt_fmt(&self, precision: usize) -> String
fn to_wkt_fmt(&self, precision: usize) -> String
Generate a WKT string similar to the
to_wkt()alternative but w/ a
given precision paramter representing the number of digits to print
after the decimal point. Note though that if precision is 0 only
the integer part of the coordinate will be shown. Read moreSource§impl PartialOrd for G
impl PartialOrd for G
Source§impl PgHasArrayType for G
impl PgHasArrayType for G
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl TryFrom<ConstGeometry<'_>> for G
impl TryFrom<ConstGeometry<'_>> for G
impl StructuralPartialEq for G
Auto Trait Implementations§
impl Freeze for G
impl RefUnwindSafe for G
impl Send for G
impl Sync for G
impl Unpin for G
impl UnwindSafe for G
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more