pub struct Variant<'scale, 'resolver, R: TypeResolver> { /* private fields */ }Expand description
A representation of the a variant type.
Implementations§
Source§impl<'scale, 'resolver, R: TypeResolver> Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R: TypeResolver> Variant<'scale, 'resolver, R>
Sourcepub fn enum_name(&self) -> Option<&'resolver str>
pub fn enum_name(&self) -> Option<&'resolver str>
Return the name of the enum type that this variant belongs to, if one was given.
Sourcepub fn path(&self) -> impl Iterator<Item = &'resolver str> + '_
pub fn path(&self) -> impl Iterator<Item = &'resolver str> + '_
Return the full path to the variant type (including the enum name) if one was given.
Sourcepub fn skip_decoding(&mut self) -> Result<(), DecodeError>
pub fn skip_decoding(&mut self) -> Result<(), DecodeError>
Skip over all bytes associated with this variant. After calling this,
Self::bytes_from_undecoded() will represent the bytes after this variant.
Sourcepub fn bytes_from_start(&self) -> &'scale [u8]
pub fn bytes_from_start(&self) -> &'scale [u8]
The bytes representing this sequence and anything following it.
Sourcepub fn bytes_from_undecoded(&self) -> &'scale [u8]
pub fn bytes_from_undecoded(&self) -> &'scale [u8]
The bytes that have not yet been decoded in this variant (this never includes the variant index at the front) and anything following it.
Auto Trait Implementations§
impl<'scale, 'resolver, R> Freeze for Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R> RefUnwindSafe for Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R> Send for Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R> Sync for Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R> Unpin for Variant<'scale, 'resolver, R>
impl<'scale, 'resolver, R> UnwindSafe for Variant<'scale, 'resolver, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more