pub trait Event: Sized {
    const NAME: &'static str;

    // Required methods
    fn match_log(log: &Log) -> bool;
    fn decode(log: &Log) -> Result<Self, String>;

    // Provided method
    fn match_and_decode(log: impl AsRef<Log>) -> Option<Self> { ... }
}

Required Associated Constants§

source

const NAME: &'static str

Required Methods§

source

fn match_log(log: &Log) -> bool

source

fn decode(log: &Log) -> Result<Self, String>

Provided Methods§

source

fn match_and_decode(log: impl AsRef<Log>) -> Option<Self>

Attempts to match and decode the log. If Self::match_log(log) is false, returns None. If it matches, but decoding fails, logs the decoding error and returns None.

Implementors§