Trait alloy_dyn_abi::EventExt

source ·
pub trait EventExt: Sealed {
    // Required method
    fn decode_log_parts<I>(
        &self,
        topics: I,
        data: &[u8],
        validate: bool,
    ) -> Result<DecodedEvent>
       where I: IntoIterator<Item = B256>;

    // Provided method
    fn decode_log(&self, log: &LogData, validate: bool) -> Result<DecodedEvent> { ... }
}
Expand description

Provides event encoding and decoding for the Event type.

This trait is sealed and cannot be implemented for types outside of this crate. It is implemented only for Event.

Required Methods§

source

fn decode_log_parts<I>( &self, topics: I, data: &[u8], validate: bool, ) -> Result<DecodedEvent>
where I: IntoIterator<Item = B256>,

Decodes the given log info according to this item’s input types.

The topics parameter is the list of indexed topics, and the data parameter is the non-indexed data.

The first topic is skipped, unless the event is anonymous.

For more details, see the Solidity reference.

§Errors

This function will return an error if the decoded data does not match the expected input types.

Provided Methods§

source

fn decode_log(&self, log: &LogData, validate: bool) -> Result<DecodedEvent>

Decodes the given log object according to this item’s input types.

See decode_log.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EventExt for Event

source§

fn decode_log_parts<I>( &self, topics: I, data: &[u8], validate: bool, ) -> Result<DecodedEvent>
where I: IntoIterator<Item = B256>,

Implementors§