Struct ethcontract::log::LogFilterBuilder [−][src]
pub struct LogFilterBuilder<T: Transport> { pub from_block: Option<BlockNumber>, pub to_block: Option<BlockNumber>, pub address: Vec<Address>, pub topics: TopicFilter, pub limit: Option<usize>, pub block_page_size: Option<NonZeroU64>, pub poll_interval: Option<Duration>, // some fields omitted }
Expand description
A log filter builder for configuring either a query for past logs or a stream that constantly queries new logs and deals with re-orgs.
Fields
from_block: Option<BlockNumber>
The block to start streaming logs from.
See web3::types::BlockNumber
for more details on possible values.
to_block: Option<BlockNumber>
The block to stop streaming logs from.
See web3::types::BlockNumber
for more details on possible values.
address: Vec<Address>
The contract addresses to filter logs for.
topics: TopicFilter
Topic filters used for filtering logs based on indexed topics.
limit: Option<usize>
Limit the number of events that can be retrieved by this filter.
Note that this is option is non-standard.
block_page_size: Option<NonZeroU64>
The page size in blocks to use when doing a paginated query on past logs. This provides no guarantee in how many logs will be returned per page, but used to limit the block range for the query.
poll_interval: Option<Duration>
The polling interval for querying the node for more logs.
Implementations
Creates a new log filter builder from the specified web3 provider.
Sets the starting block from which to stream logs for.
If left unset defaults to the latest block.
Sets the last block from which to stream logs for.
If left unset defaults to the streaming until the end of days.
Adds an address filter to only retrieve logs that were emitted by a contract matching the povided addresses.
Adds a filter for the first indexed topic.
For regular events, this corresponds to the event signature. For anonymous events, this is the first indexed property.
Limit the number of events that can be retrieved by this filter.
Note that this parameter is non-standard.
The page size in blocks to use when doing a paginated query on past events.
Panics
Panics if a block page size of 0 is specified.
The polling interval. This is used as the interval between consecutive
eth_getLogs
calls to get log updates.
Returns a web3 filter builder needed for querying and streaming logs.
Performs a eth_getLogs
query to past logs. For large block ranges,
such as retrieving all contract logs since genesis, it is recommended to
use the past_logs_pages
method instead.
Returns a stream that resolves into a page of logs matching the filter builder’s parameters.
Creates a filter-based log stream that emits logs for each filter change.