alloy_sol_types

Trait TopicList

Source
pub trait TopicList: SolType + Sealed {
    const COUNT: usize;

    // Required method
    fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
       where I: IntoIterator<Item = D>,
             D: Into<WordToken>;
}
Expand description

A list of Solidity event topics.

This trait is implemented only on tuples of arity up to 4. The tuples must contain only SolTypes where the token is a WordToken, and as such it is sealed to prevent prevent incorrect downstream implementations.

See the Solidity event ABI specification for more details on how events’ topics are encoded.

§Implementer’s Guide

It should not be necessary to implement this trait manually. Instead, use the sol! procedural macro to parse Solidity syntax into types that implement this trait.

Required Associated Constants§

Source

const COUNT: usize

The number of topics.

Required Methods§

Source

fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Detokenize the topics into a tuple of rust types.

This function accepts an iterator of WordToken.

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.

Implementations on Foreign Types§

Source§

impl TopicList for ()

Source§

const COUNT: usize = 0usize

Source§

fn detokenize<I, D>(_: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Source§

impl<'a, 'b, 'c, 'd, T: SolType<Token<'a> = WordToken>, U: SolType<Token<'b> = WordToken>, V: SolType<Token<'c> = WordToken>, W: SolType<Token<'d> = WordToken>> TopicList for (T, U, V, W)

Source§

const COUNT: usize = 4usize

Source§

fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Source§

impl<'a, 'b, 'c, T: SolType<Token<'a> = WordToken>, U: SolType<Token<'b> = WordToken>, V: SolType<Token<'c> = WordToken>> TopicList for (T, U, V)

Source§

const COUNT: usize = 3usize

Source§

fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Source§

impl<'a, 'b, T: SolType<Token<'a> = WordToken>, U: SolType<Token<'b> = WordToken>> TopicList for (T, U)

Source§

const COUNT: usize = 2usize

Source§

fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Source§

impl<'a, T: SolType<Token<'a> = WordToken>> TopicList for (T,)

Source§

const COUNT: usize = 1usize

Source§

fn detokenize<I, D>(topics: I) -> Result<Self::RustType>
where I: IntoIterator<Item = D>, D: Into<WordToken>,

Implementors§