pub trait TopicEncoder: Sealed + Sized {
const REQUIRES_BUFFER: bool;
// Required methods
fn encode_topic<T>(value: &T) -> [u8; 32]
where T: AbiEncodeWith<Self>;
fn encode_topic_with_hash_buffer<T>(
value: &T,
output: &mut [u8; 32],
buffer: &mut [u8],
)
where T: AbiEncodeWith<Self>;
}
Expand description
Specifies the topic (i.e. indexed event parameter) encoding implementation for the given ABI.
Required Associated Constants§
Sourceconst REQUIRES_BUFFER: bool
const REQUIRES_BUFFER: bool
True if the topic hashing implementation requires a buffer.
(e.g. when hashing requires calling a pre-compile).
Required Methods§
Sourcefn encode_topic<T>(value: &T) -> [u8; 32]where
T: AbiEncodeWith<Self>,
fn encode_topic<T>(value: &T) -> [u8; 32]where
T: AbiEncodeWith<Self>,
Encodes the value as a topic (i.e. an indexed event parameter).
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.