Trait oasis_contract_sdk::event::Event[][src]

pub trait Event: Sized + Encode {
    fn module_name(&self) -> &str;
fn code(&self) -> u32; fn into_raw(self) -> Event { ... } }
Expand description

An event emitted by the contract.

This trait can be derived:

#[derive(Clone, Debug, cbor::Encode, Event)]
#[cbor(untagged)]
#[sdk_event(autonumber)]
enum MyEvent {
   Greeting(String),      // autonumbered to 0
   #[sdk_event(code = 2)] // manually numbered to 2 (`code` is required if not autonumbering)
   DontPanic,
   Salutation {           // autonumbered to 1
       plural: bool,
   }
}

Required methods

Name of the module that emitted the event.

Code uniquely identifying the event.

Provided methods

Converts an event into the raw event type that can be emitted from the contract.

Implementations on Foreign Types

Implementors