pub struct FilterWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> FilterWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> FilterWalker<'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_ascii(&self) -> bool
pub fn is_ascii(&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_ascii(self) -> Result<(), Error>
pub fn into_ascii(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_ascii(self) -> Result<(), Error>
pub fn decode_ascii(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_edge_ngram(&self) -> bool
pub fn is_edge_ngram(&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 edge_ngram_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn edge_ngram_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_lowercase(&self) -> bool
pub fn is_lowercase(&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_lowercase(self) -> Result<(), Error>
pub fn into_lowercase(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_lowercase(self) -> Result<(), Error>
pub fn decode_lowercase(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_ngram(&self) -> bool
pub fn is_ngram(&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 ngram_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn ngram_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_snowball(&self) -> bool
pub fn is_snowball(&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_snowball(
self,
) -> Result<<Language as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_snowball( self, ) -> Result<<Language 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_snowball(self) -> Result<Language, Error>
pub fn decode_snowball(self) -> Result<Language, 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 snowball_view(self) -> Result<VariantView<'r, Language>, Error>
pub fn snowball_view(self) -> Result<VariantView<'r, Language>, 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_uppercase(&self) -> bool
pub fn is_uppercase(&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_uppercase(self) -> Result<(), Error>
pub fn into_uppercase(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_uppercase(self) -> Result<(), Error>
pub fn decode_uppercase(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_mapper(&self) -> bool
pub fn is_mapper(&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_mapper(
self,
) -> Result<<String as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_mapper( self, ) -> Result<<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_mapper(self) -> Result<String, Error>
pub fn decode_mapper(self) -> Result<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 mapper_view(self) -> Result<VariantView<'r, String>, Error>
pub fn mapper_view(self) -> Result<VariantView<'r, 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.