pub enum Parameter {
Address(H256),
Bool(H256),
Int(H256, usize),
Uint(H256, usize),
String(Vec<u8>),
Bytes(Vec<u8>),
FixedBytes(Vec<u8>),
Array(Vec<Parameter>),
FixedArray(Vec<Parameter>),
Tuple(Vec<Parameter>),
}Expand description
An ABI function parameter type enclosing the underlying numeric data bytes.
Variants§
Address(H256)
Bool(H256)
Int(H256, usize)
Uint(H256, usize)
String(Vec<u8>)
Bytes(Vec<u8>)
FixedBytes(Vec<u8>)
Array(Vec<Parameter>)
FixedArray(Vec<Parameter>)
Tuple(Vec<Parameter>)
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn static_encode(&self) -> Vec<u8> ⓘ
pub fn static_encode(&self) -> Vec<u8> ⓘ
Encodes strictly the data part of the underlying type.
It will not check whether the parameter is dynamic or not, it simply encodes the enclosed data in place. For some types, it first writes the number of elements of the data in bytes. For further info, check the Solidity contract ABI specification.
Sourcepub fn is_dynamic(&self) -> bool
pub fn is_dynamic(&self) -> bool
Recursively checks wether a given parameter is dynamic.
For example, a Tuple can be dynamic if any of its
contained types are dynamic. Additionally, a
FixedArray is static if it contains values
with static type and dynamic otherwise.
pub fn decode(parameter_type: &ParameterType, raw_bytes: &[u8]) -> (Self, usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
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