[][src]Trait mantle::exe::Event

pub trait Event {
    type Topics;
    fn emit(&self);
}

Associated Types

type Topics

A struct implementing the builder pattern for setting topics.

For example,

#[derive(Event)]
struct MyEvent {
   #[indexed]
   my_topic: U256
   #[indexed]
   my_other_topic: U256,
}

let topics: Vec<H256> = MyTopics::Topics::default()
   .set_my_other_topic(&U256::from(42))
   .hash();
// topics = vec![0, keccak256(abi_encode(my_other_topic))]
Loading content...

Required methods

fn emit(&self)

Emits an event tagged with the (keccak) hashed function name and topics.

Loading content...

Implementors

Loading content...