Struct ethers::types::Filter[][src]

pub struct Filter {
    pub block_option: FilterBlockOption,
    pub topics: [Option<ValueOrArray<H256>>; 4],
    // some fields omitted
}
Expand description

Filter for

Fields

block_option: FilterBlockOption

Filter block options, specifying on which blocks the filter should match.

topics: [Option<ValueOrArray<H256>>; 4]

Topics

Implementations

Sets the inner filter object

NOTE: ranges are always inclusive

Examples

Match only a specific block

let filter = Filter::new().select(69u64);

This is the same as Filter::new().from_block(1337u64).to_block(1337u64)

Match the latest block only

let filter = Filter::new().select(BlockNumber::Latest);

Match a block by its hash

let filter = Filter::new().select(H256::zero());

This is the same as at_block_hash

Match a range of blocks

let filter = Filter::new().select(0u64..100u64);

Match all blocks in range (1337..BlockNumber::Latest)

let filter = Filter::new().select(1337u64..);

Match all blocks in range (BlockNumber::Earliest..1337)

let filter = Filter::new().select(..1337u64);

given the event in string form, it hashes it and adds it to the topics to monitor

Sets topic0 (the event name for non-anonymous events)

Sets the 1st indexed topic

Sets the 2nd indexed topic

Sets the 3rd indexed topic

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more