pub struct GraphQLFunctionsConfigWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> GraphQLFunctionsConfigWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> GraphQLFunctionsConfigWalker<'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_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_auto(&self) -> bool
pub fn is_auto(&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_auto(self) -> Result<(), Error>
pub fn into_auto(self) -> Result<(), Error>
Verify the wire encoding identifies the unit variant
#variant_ident and return ().
Sourcepub fn decode_auto(self) -> Result<(), Error>
pub fn decode_auto(self) -> Result<(), Error>
Decode the unit variant — same as into_<variant> for
unit variants, kept for API symmetry.
Sourcepub fn is_include(&self) -> bool
pub fn is_include(&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_include(
self,
) -> Result<<Vec<Strand> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_include( self, ) -> Result<<Vec<Strand> 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_include(self) -> Result<Vec<Strand>, Error>
pub fn decode_include(self) -> Result<Vec<Strand>, 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 include_view(self) -> Result<VariantView<'r, Vec<Strand>>, Error>
pub fn include_view(self) -> Result<VariantView<'r, Vec<Strand>>, 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_exclude(&self) -> bool
pub fn is_exclude(&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_exclude(
self,
) -> Result<<Vec<Strand> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_exclude( self, ) -> Result<<Vec<Strand> 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_exclude(self) -> Result<Vec<Strand>, Error>
pub fn decode_exclude(self) -> Result<Vec<Strand>, 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 exclude_view(self) -> Result<VariantView<'r, Vec<Strand>>, Error>
pub fn exclude_view(self) -> Result<VariantView<'r, Vec<Strand>>, 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.