Struct fuels_types::enum_variants::EnumVariants
source · pub struct EnumVariants { /* private fields */ }
Implementations§
source§impl EnumVariants
impl EnumVariants
pub fn new(param_types: Vec<ParamType>) -> Result<EnumVariants>
pub fn param_types(&self) -> &[ParamType]
pub fn param_type_of_variant(&self, discriminant: u8) -> Result<&ParamType>
pub fn only_units_inside(&self) -> bool
sourcepub fn compute_encoding_width_of_enum(&self) -> usize
pub fn compute_encoding_width_of_enum(&self) -> usize
Calculates how many WORDs are needed to encode an enum.
sourcepub fn compute_padding_amount(&self, variant_param_type: &ParamType) -> usize
pub fn compute_padding_amount(&self, variant_param_type: &ParamType) -> usize
Determines the padding needed for the provided enum variant (based on the width of the biggest variant) and returns it.
Trait Implementations§
source§impl Clone for EnumVariants
impl Clone for EnumVariants
source§fn clone(&self) -> EnumVariants
fn clone(&self) -> EnumVariants
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EnumVariants
impl Debug for EnumVariants
source§impl PartialEq<EnumVariants> for EnumVariants
impl PartialEq<EnumVariants> for EnumVariants
source§fn eq(&self, other: &EnumVariants) -> bool
fn eq(&self, other: &EnumVariants) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for EnumVariants
impl StructuralEq for EnumVariants
impl StructuralPartialEq for EnumVariants
Auto Trait Implementations§
impl RefUnwindSafe for EnumVariants
impl Send for EnumVariants
impl Sync for EnumVariants
impl Unpin for EnumVariants
impl UnwindSafe for EnumVariants
Blanket Implementations§
§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying type as
Any
.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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.