pub struct OperationWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned enum. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> OperationWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> OperationWalker<'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_add(&self) -> bool
pub fn is_add(&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 add_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn add_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_remove(&self) -> bool
pub fn is_remove(&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 remove_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn remove_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_replace(&self) -> bool
pub fn is_replace(&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 replace_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn replace_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_change(&self) -> bool
pub fn is_change(&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 change_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn change_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_copy(&self) -> bool
pub fn is_copy(&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 copy_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn copy_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_move(&self) -> bool
pub fn is_move(&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 move_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn move_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_test(&self) -> bool
pub fn is_test(&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 test_view(self) -> Result<VariantView<'r, ()>, Error>
pub fn test_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).