pub trait Encode<const N: usize>: Sized {
// Required method
fn tokenize(&self) -> [Token; N];
// Provided methods
fn encode(&self) -> EncodeCell<Self> { ... }
fn keccak256(&self) -> KeccakHash { ... }
fn signable_keccak256(&self) -> KeccakHash { ... }
}Expand description
Contains a method to encode data to a format compatible with Ethereum.
Required Methods§
Provided Methods§
Sourcefn encode(&self) -> EncodeCell<Self>
fn encode(&self) -> EncodeCell<Self>
Returns the encoded Token instances, in a type-safe enclosure.
Sourcefn keccak256(&self) -> KeccakHash
fn keccak256(&self) -> KeccakHash
Encodes a slice of Token instances, and returns the
keccak hash of the encoded string.
Sourcefn signable_keccak256(&self) -> KeccakHash
fn signable_keccak256(&self) -> KeccakHash
Encodes a slice of Token instances, and returns the
keccak hash of the encoded string appended to an Ethereum
signature header. This can then be signed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.