Trait StaticEvent

Source
pub trait StaticEvent: Decode {
    const PALLET: &'static str;
    const EVENT: &'static str;

    // Provided method
    fn is_event(pallet: &str, event: &str) -> bool { ... }
}
Expand description

Trait to uniquely identify the events’s identity from the runtime metadata.

Generated API structures that represent an event implement this trait.

The trait is utilized to decode emitted events from a block, via obtaining the form of the Event from the metadata.

Required Associated Constants§

Source

const PALLET: &'static str

Pallet name.

Source

const EVENT: &'static str

Event name.

Provided Methods§

Source

fn is_event(pallet: &str, event: &str) -> bool

Returns true if the given pallet and event names match this event.

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.

Implementors§