pub struct ModuleExecutableWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> ModuleExecutableWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> ModuleExecutableWalker<'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_surrealism(&self) -> bool
pub fn is_surrealism(&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_surrealism(
self,
) -> Result<<SurrealismExecutable as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_surrealism( self, ) -> Result<<SurrealismExecutable 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_surrealism(self) -> Result<SurrealismExecutable, Error>
pub fn decode_surrealism(self) -> Result<SurrealismExecutable, 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 surrealism_view(
self,
) -> Result<VariantView<'r, SurrealismExecutable>, Error>
pub fn surrealism_view( self, ) -> Result<VariantView<'r, SurrealismExecutable>, 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_silo(&self) -> bool
pub fn is_silo(&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_silo(
self,
) -> Result<<SiloExecutable as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_silo( self, ) -> Result<<SiloExecutable 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_silo(self) -> Result<SiloExecutable, Error>
pub fn decode_silo(self) -> Result<SiloExecutable, 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 silo_view(self) -> Result<VariantView<'r, SiloExecutable>, Error>
pub fn silo_view(self) -> Result<VariantView<'r, SiloExecutable>, 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.