[][src]Struct ethcontract::contract::EventBuilder

#[must_use = "event builders do nothing unless you stream them"]pub struct EventBuilder<T: Transport, E: Detokenize> {
    pub topics: RawTopicFilter,
    pub poll_interval: Option<Duration>,
    // some fields omitted
}

A builder for creating a filtered stream of contract events that are

Fields

topics: RawTopicFilter

The topic filters that are encoded based on the event ABI.

poll_interval: Option<Duration>

The polling interval for querying the node for more events.

Methods

impl<T: Transport, E: Detokenize> EventBuilder<T, E>[src]

pub fn new(web3: Web3<T>, event: AbiEvent, address: Address) -> Self[src]

Creates a new event builder from a web3 provider and a contract event and address.

pub fn from_block(self, block: BlockNumber) -> Self[src]

Sets the starting block from which to stream logs for.

If left unset defaults to the latest block.

pub fn to_block(self, block: BlockNumber) -> Self[src]

Sets the last block from which to stream logs for.

If left unset defaults to the streaming until the end of days.

pub fn limit(self, value: usize) -> Self[src]

Limit the number of events that can be retrieved by this filter.

Note that this parameter is non-standard.

pub fn topic0<P>(self, topic: Topic<P>) -> Self where
    P: Tokenizable
[src]

Adds a filter for the first indexed topic.

This corresponds to the first indexed property, which for anonymous events corresponds to topic[0] in the log, and for named events is actually topic[1].

pub fn topic1<P>(self, topic: Topic<P>) -> Self where
    P: Tokenizable
[src]

Adds a filter for the second indexed topic.

pub fn topic2<P>(self, topic: Topic<P>) -> Self where
    P: Tokenizable
[src]

Adds a filter for the third indexed topic.

pub fn poll_interval(self, value: Duration) -> Self[src]

The polling interval. This is used as the interval between consecutive eth_getFilterChanges calls to get filter updates.

pub fn query(self) -> Result<QueryFuture<T, E>, EventError>[src]

Returns a future that resolves with a collection of all existing logs matching the builder parameters.

pub fn stream(self) -> Result<EventStream<T, E>, EventError>[src]

Creates an event stream from the current event builder that emits new events.

Auto Trait Implementations

impl<T, E> RefUnwindSafe for EventBuilder<T, E> where
    E: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, E> Send for EventBuilder<T, E> where
    E: Send,
    T: Send

impl<T, E> Sync for EventBuilder<T, E> where
    E: Sync,
    T: Sync

impl<T, E> Unpin for EventBuilder<T, E> where
    E: Unpin,
    T: Unpin

impl<T, E> UnwindSafe for EventBuilder<T, E> where
    E: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,