pub trait Event: Encode {
type RemainingTopics: EventTopicsAmount;
const SIGNATURE_TOPIC: Option<[u8; 32]>;
// Required method
fn topics<E, B>(
&self,
builder: TopicsBuilder<Uninit, E, B>,
) -> <B as TopicsBuilderBackend<E>>::Output
where E: Environment,
B: TopicsBuilderBackend<E>;
}
Expand description
Implemented by event types to guide the event topic serialization using the topics builder.
Normally this trait should be implemented automatically via #[derive(ink::Event)
.
Required Associated Constants§
Sourceconst SIGNATURE_TOPIC: Option<[u8; 32]>
const SIGNATURE_TOPIC: Option<[u8; 32]>
The unique signature topic of the event. None
for anonymous events.
It can be automatically calculated or manually specified.
Usually this is calculated using the #[derive(ink::Event)]
derive, which by
default calculates this as blake2b("Event(field1_type,field2_type)"
Required Associated Types§
Sourcetype RemainingTopics: EventTopicsAmount
type RemainingTopics: EventTopicsAmount
Type state indicating how many event topics are to be expected by the topics builder.
Required Methods§
Sourcefn topics<E, B>(
&self,
builder: TopicsBuilder<Uninit, E, B>,
) -> <B as TopicsBuilderBackend<E>>::Outputwhere
E: Environment,
B: TopicsBuilderBackend<E>,
fn topics<E, B>(
&self,
builder: TopicsBuilder<Uninit, E, B>,
) -> <B as TopicsBuilderBackend<E>>::Outputwhere
E: Environment,
B: TopicsBuilderBackend<E>,
Guides event topic serialization using the given topics builder.
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.