[][src]Struct ethers_contract::builders::Event

#[must_use = "event filters do nothing unless you `query` or `stream` them"]pub struct Event<'a: 'b, 'b, P, D> {
    pub filter: Filter,
    pub event: &'b AbiEvent,
    // some fields omitted
}

Helper for managing the event filter before querying or streaming its logs

Fields

filter: Filter

The event filter's state

event: &'b AbiEvent

The ABI of the event which is being filtered

Implementations

impl<'_, '_, P, D: Detokenize> Event<'_, '_, P, D>[src]

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

Sets the filter's from block

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

Sets the filter's to block

pub fn topic0<T: Into<ValueOrArray<H256>>>(self, topic: T) -> Self[src]

Sets the filter's 0th topic (typically the event name for non-anonymous events)

pub fn topic1<T: Into<ValueOrArray<H256>>>(self, topic: T) -> Self[src]

Sets the filter's 1st topic

pub fn topic2<T: Into<ValueOrArray<H256>>>(self, topic: T) -> Self[src]

Sets the filter's 2nd topic

pub fn topic3<T: Into<ValueOrArray<H256>>>(self, topic: T) -> Self[src]

Sets the filter's 3rd topic

impl<'a, 'b, P, D> Event<'a, 'b, P, D> where
    P: JsonRpcClient,
    D: 'b + Detokenize + Clone,
    'a: 'b, 
[src]

pub async fn stream(
    self
) -> Result<impl Stream<Item = Result<D, ContractError>> + 'b, ContractError>
[src]

Returns a stream for the event

impl<'_, '_, P, D> Event<'_, '_, P, D> where
    P: JsonRpcClient,
    D: Detokenize + Clone
[src]

pub async fn query<'_>(&'_ self) -> Result<Vec<D>, ContractError>[src]

Queries the blockchain for the selected filter and returns a vector of matching event logs

pub async fn query_with_hashes<'_>(
    &'_ self
) -> Result<HashMap<H256, D>, ContractError>
[src]

Queries the blockchain for the selected filter and returns a hashmap of txhash -> logs

Auto Trait Implementations

impl<'a, 'b, P, D> RefUnwindSafe for Event<'a, 'b, P, D> where
    D: RefUnwindSafe,
    P: RefUnwindSafe

impl<'a, 'b, P, D> Send for Event<'a, 'b, P, D> where
    D: Send,
    P: Sync

impl<'a, 'b, P, D> Sync for Event<'a, 'b, P, D> where
    D: Sync,
    P: Sync

impl<'a, 'b, P, D> Unpin for Event<'a, 'b, P, D> where
    D: Unpin

impl<'a, 'b, P, D> UnwindSafe for Event<'a, 'b, P, D> where
    D: UnwindSafe,
    P: RefUnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,