Enum fuels_types::param_types::ParamType
source · pub enum ParamType {
}
Variants§
U8
U16
U32
U64
U128
Bool
B256
Unit
Array(Box<ParamType>, usize)
Vector(Box<ParamType>)
String(usize)
Struct
Enum
Tuple(Vec<ParamType>)
RawSlice
Bytes
Implementations§
source§impl ParamType
impl ParamType
pub fn get_return_location(&self) -> ReturnLocation
sourcepub fn calculate_num_of_elements(
param_type: &ParamType,
available_bytes: usize
) -> Result<usize>
pub fn calculate_num_of_elements( param_type: &ParamType, available_bytes: usize ) -> Result<usize>
pub fn contains_nested_heap_types(&self) -> bool
pub fn is_vm_heap_type(&self) -> bool
sourcepub fn heap_inner_element_size(&self) -> Option<usize>
pub fn heap_inner_element_size(&self) -> Option<usize>
Compute the inner memory size of a containing heap type (Bytes
or Vec
s).
sourcepub fn compute_encoding_width(&self) -> usize
pub fn compute_encoding_width(&self) -> usize
Calculates the number of WORD
s the VM expects this parameter to be encoded in.
sourcepub fn try_from_type_application(
type_application: &TypeApplication,
type_lookup: &HashMap<usize, TypeDeclaration>
) -> Result<Self>
pub fn try_from_type_application( type_application: &TypeApplication, type_lookup: &HashMap<usize, TypeDeclaration> ) -> Result<Self>
For when you need to convert a ABI JSON’s TypeApplication into a ParamType.
Arguments
type_application
: The TypeApplication you wish to convert into a ParamTypetype_lookup
: A HashMap of TypeDeclarations mentioned in the TypeApplication where the type id is the key.
Trait Implementations§
source§impl PartialEq<ParamType> for ParamType
impl PartialEq<ParamType> for ParamType
impl Eq for ParamType
impl StructuralEq for ParamType
impl StructuralPartialEq for ParamType
Auto Trait Implementations§
impl RefUnwindSafe for ParamType
impl Send for ParamType
impl Sync for ParamType
impl Unpin for ParamType
impl UnwindSafe for ParamType
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.