Trait alloy_sol_types::SolEnum
source · pub trait SolEnum: Sized + Copy + Into<u8> + TryFrom<u8, Error = Error> {
const COUNT: usize;
// Provided methods
fn tokenize(self) -> WordToken { ... }
fn abi_decode(data: &[u8], validate: bool) -> Result<Self> { ... }
fn abi_encode_raw(self, out: &mut Vec<u8>) { ... }
fn abi_encode(self) -> Vec<u8> ⓘ { ... }
}
Expand description
A Solidity enum. This is always a wrapper around a u8
.
Implementer’s Guide
It should not be necessary to implement this trait manually. Instead, use
the sol!
procedural macro to parse Solidity syntax into
types that implement this trait.
Required Associated Constants§
Provided Methods§
sourcefn abi_decode(data: &[u8], validate: bool) -> Result<Self>
fn abi_decode(data: &[u8], validate: bool) -> Result<Self>
ABI decode the enum from the given buffer.
sourcefn abi_encode_raw(self, out: &mut Vec<u8>)
fn abi_encode_raw(self, out: &mut Vec<u8>)
ABI encode the enum into the given buffer.
sourcefn abi_encode(self) -> Vec<u8> ⓘ
fn abi_encode(self) -> Vec<u8> ⓘ
ABI encode the enum.