pub struct KindWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> KindWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> KindWalker<'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_any(&self) -> bool
pub fn is_any(&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_any(self) -> Result<(), Error>
pub fn into_any(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_any(self) -> Result<(), Error>
pub fn decode_any(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_none(&self) -> bool
pub fn is_none(&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_none(self) -> Result<(), Error>
pub fn into_none(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_none(self) -> Result<(), Error>
pub fn decode_none(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&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_null(self) -> Result<(), Error>
pub fn into_null(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_null(self) -> Result<(), Error>
pub fn decode_null(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_bool(&self) -> bool
pub fn is_bool(&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_bool(self) -> Result<(), Error>
pub fn into_bool(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_bool(self) -> Result<(), Error>
pub fn decode_bool(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_bytes(&self) -> bool
pub fn is_bytes(&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_bytes(self) -> Result<(), Error>
pub fn into_bytes(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_bytes(self) -> Result<(), Error>
pub fn decode_bytes(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_datetime(&self) -> bool
pub fn is_datetime(&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_datetime(self) -> Result<(), Error>
pub fn into_datetime(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_datetime(self) -> Result<(), Error>
pub fn decode_datetime(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_decimal(&self) -> bool
pub fn is_decimal(&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_decimal(self) -> Result<(), Error>
pub fn into_decimal(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_decimal(self) -> Result<(), Error>
pub fn decode_decimal(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_duration(&self) -> bool
pub fn is_duration(&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_duration(self) -> Result<(), Error>
pub fn into_duration(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_duration(self) -> Result<(), Error>
pub fn decode_duration(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_float(&self) -> bool
pub fn is_float(&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_float(self) -> Result<(), Error>
pub fn into_float(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_float(self) -> Result<(), Error>
pub fn decode_float(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_int(&self) -> bool
pub fn is_int(&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_int(self) -> Result<(), Error>
pub fn into_int(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_int(self) -> Result<(), Error>
pub fn decode_int(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_number(&self) -> bool
pub fn is_number(&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_number(self) -> Result<(), Error>
pub fn into_number(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_number(self) -> Result<(), Error>
pub fn decode_number(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_object(&self) -> bool
pub fn is_object(&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_object(self) -> Result<(), Error>
pub fn into_object(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_object(self) -> Result<(), Error>
pub fn decode_object(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&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_string(self) -> Result<(), Error>
pub fn into_string(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_string(self) -> Result<(), Error>
pub fn decode_string(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_uuid(&self) -> bool
pub fn is_uuid(&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_uuid(self) -> Result<(), Error>
pub fn into_uuid(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_uuid(self) -> Result<(), Error>
pub fn decode_uuid(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_regex(&self) -> bool
pub fn is_regex(&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_regex(self) -> Result<(), Error>
pub fn into_regex(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_regex(self) -> Result<(), Error>
pub fn decode_regex(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_table(&self) -> bool
pub fn is_table(&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_table(
self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_table( self, ) -> Result<<Vec<TableName> 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_table(self) -> Result<Vec<TableName>, Error>
pub fn decode_table(self) -> Result<Vec<TableName>, 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 table_view(self) -> Result<VariantView<'r, Vec<TableName>>, Error>
pub fn table_view(self) -> Result<VariantView<'r, Vec<TableName>>, 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_record(&self) -> bool
pub fn is_record(&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_record(
self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_record( self, ) -> Result<<Vec<TableName> 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_record(self) -> Result<Vec<TableName>, Error>
pub fn decode_record(self) -> Result<Vec<TableName>, 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 record_view(self) -> Result<VariantView<'r, Vec<TableName>>, Error>
pub fn record_view(self) -> Result<VariantView<'r, Vec<TableName>>, 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_geometry(&self) -> bool
pub fn is_geometry(&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_geometry(
self,
) -> Result<<Vec<GeometryKind> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_geometry( self, ) -> Result<<Vec<GeometryKind> 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_geometry(self) -> Result<Vec<GeometryKind>, Error>
pub fn decode_geometry(self) -> Result<Vec<GeometryKind>, 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 geometry_view(self) -> Result<VariantView<'r, Vec<GeometryKind>>, Error>
pub fn geometry_view(self) -> Result<VariantView<'r, Vec<GeometryKind>>, 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_either(&self) -> bool
pub fn is_either(&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_either(
self,
) -> Result<<Vec<Kind> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_either( self, ) -> Result<<Vec<Kind> 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_either(self) -> Result<Vec<Kind>, Error>
pub fn decode_either(self) -> Result<Vec<Kind>, 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 either_view(self) -> Result<VariantView<'r, Vec<Kind>>, Error>
pub fn either_view(self) -> Result<VariantView<'r, Vec<Kind>>, 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_set(&self) -> bool
pub fn is_set(&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 set_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn set_view(self) -> Result<VariantView<'r, ()>, Error>
Return the variant payload bytes as a
VariantView.
Multi-field tuple and struct variants have no single
inner type, so into_<variant> is not available;
this _view hands you the body bytes and you can
decode the variant’s fields sequentially (or feed
the bytes into another walker).
Sourcepub fn is_array(&self) -> bool
pub fn is_array(&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 array_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn array_view(self) -> Result<VariantView<'r, ()>, Error>
Return the variant payload bytes as a
VariantView.
Multi-field tuple and struct variants have no single
inner type, so into_<variant> is not available;
this _view hands you the body bytes and you can
decode the variant’s fields sequentially (or feed
the bytes into another walker).
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&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 function_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn function_view(self) -> Result<VariantView<'r, ()>, Error>
Return the variant payload bytes as a
VariantView.
Multi-field tuple and struct variants have no single
inner type, so into_<variant> is not available;
this _view hands you the body bytes and you can
decode the variant’s fields sequentially (or feed
the bytes into another walker).
Sourcepub fn is_range(&self) -> bool
pub fn is_range(&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_range(self) -> Result<(), Error>
pub fn into_range(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_range(self) -> Result<(), Error>
pub fn decode_range(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&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_literal(
self,
) -> Result<<KindLiteral as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_literal( self, ) -> Result<<KindLiteral 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_literal(self) -> Result<KindLiteral, Error>
pub fn decode_literal(self) -> Result<KindLiteral, 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 literal_view(self) -> Result<VariantView<'r, KindLiteral>, Error>
pub fn literal_view(self) -> Result<VariantView<'r, KindLiteral>, 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_file(&self) -> bool
pub fn is_file(&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_file(
self,
) -> Result<<Vec<String> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_file( self, ) -> Result<<Vec<String> 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_file(self) -> Result<Vec<String>, Error>
pub fn decode_file(self) -> Result<Vec<String>, 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 file_view(self) -> Result<VariantView<'r, Vec<String>>, Error>
pub fn file_view(self) -> Result<VariantView<'r, Vec<String>>, 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.