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
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Filter
impl UnwindSafe for Filter
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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