pub struct GeometryWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> GeometryWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> GeometryWalker<'r, R>
Sourcepub fn discriminant(&self) -> u32
pub fn discriminant(&self) -> u32
Variant discriminant on the wire (for Wire) or on the
re-encoded current-rev bytes (for the borrowed / owned arms).
Use
walk_revisioned_variant_name
to map this to a variant identifier.
Sourcepub fn is_point(&self) -> bool
pub fn is_point(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_point(
self,
) -> Result<<Point<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_point( self, ) -> Result<<Point<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_point(self) -> Result<Point<f64>, Error>
pub fn decode_point(self) -> Result<Point<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn point_view(self) -> Result<VariantView<'r, Point<f64>>, Error>
pub fn point_view(self) -> Result<VariantView<'r, Point<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_line(&self) -> bool
pub fn is_line(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_line(
self,
) -> Result<<LineString<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_line( self, ) -> Result<<LineString<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_line(self) -> Result<LineString<f64>, Error>
pub fn decode_line(self) -> Result<LineString<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn line_view(self) -> Result<VariantView<'r, LineString<f64>>, Error>
pub fn line_view(self) -> Result<VariantView<'r, LineString<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_polygon(&self) -> bool
pub fn is_polygon(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_polygon(
self,
) -> Result<<Polygon<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_polygon( self, ) -> Result<<Polygon<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_polygon(self) -> Result<Polygon<f64>, Error>
pub fn decode_polygon(self) -> Result<Polygon<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn polygon_view(self) -> Result<VariantView<'r, Polygon<f64>>, Error>
pub fn polygon_view(self) -> Result<VariantView<'r, Polygon<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_multi_point(&self) -> bool
pub fn is_multi_point(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_multi_point(
self,
) -> Result<<MultiPoint<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_multi_point( self, ) -> Result<<MultiPoint<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_multi_point(self) -> Result<MultiPoint<f64>, Error>
pub fn decode_multi_point(self) -> Result<MultiPoint<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn multi_point_view(self) -> Result<VariantView<'r, MultiPoint<f64>>, Error>
pub fn multi_point_view(self) -> Result<VariantView<'r, MultiPoint<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_multi_line(&self) -> bool
pub fn is_multi_line(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_multi_line(
self,
) -> Result<<MultiLineString<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_multi_line( self, ) -> Result<<MultiLineString<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_multi_line(self) -> Result<MultiLineString<f64>, Error>
pub fn decode_multi_line(self) -> Result<MultiLineString<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn multi_line_view(
self,
) -> Result<VariantView<'r, MultiLineString<f64>>, Error>
pub fn multi_line_view( self, ) -> Result<VariantView<'r, MultiLineString<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_multi_polygon(&self) -> bool
pub fn is_multi_polygon(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_multi_polygon(
self,
) -> Result<<MultiPolygon<f64> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_multi_polygon( self, ) -> Result<<MultiPolygon<f64> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_multi_polygon(self) -> Result<MultiPolygon<f64>, Error>
pub fn decode_multi_polygon(self) -> Result<MultiPolygon<f64>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn multi_polygon_view(
self,
) -> Result<VariantView<'r, MultiPolygon<f64>>, Error>
pub fn multi_polygon_view( self, ) -> Result<VariantView<'r, MultiPolygon<f64>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Returns true if the wire’s discriminant identifies this variant
at the wire revision (or, for borrowed / owned walkers, on the
current-rev bytes).
Sourcepub fn into_collection(
self,
) -> Result<<Vec<Geometry> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_collection( self, ) -> Result<<Vec<Geometry> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into the payload of the #variant_ident variant.
Errors with revision::Error::Deserialize if the
wire encoding does not identify this variant. Errors
with revision::Error::Conversion in materialised
mode (older-rev convert_fn types); callers should
use decode_<variant> in that case.
Sourcepub fn decode_collection(self) -> Result<Vec<Geometry>, Error>
pub fn decode_collection(self) -> Result<Vec<Geometry>, Error>
Decode and return the inner value of the #variant_ident
variant directly. Unlike into_<variant>, this works on
every repr (Wire, OptimisedBorrowed, ConvertedOwned)
because it deserialises by value rather than handing back
a sub-walker.
Sourcepub fn collection_view(self) -> Result<VariantView<'r, Vec<Geometry>>, Error>
pub fn collection_view(self) -> Result<VariantView<'r, Vec<Geometry>>, Error>
Return the variant payload as a VariantView.
Works on every repr. OptimisedBorrowed (the common
optimised-enum case) hands back a borrowed slice with
the source’s 'r lifetime — no allocation. Wire
walkers re-encode (one allocation); ConvertedOwned
(cross-revision convert_fn) walkers move the owned
bytes.
Use decode_<variant> when you
want the inner type by value directly.