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

#[must_use = "event filters do nothing unless you `query` or `stream` them"]pub struct Event<'a: 'b, 'b, M, 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<M, D: Detokenize> Event<'_, '_, M, 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, M, D> Event<'a, 'b, M, D> where
    M: Middleware,
    D: 'b + Detokenize + Clone
[src]

pub async fn stream(
    &'a self
) -> Result<EventStream<'a, FilterWatcher<'a, M::Provider, Log>, D, ContractError<M>>, ContractError<M>>
[src]

Returns a stream for the event

impl<'a, 'b, M, D> Event<'a, 'b, M, D> where
    M: Middleware,
    <M as Middleware>::Provider: PubsubClient,
    D: 'b + Detokenize + Clone
[src]

pub async fn subscribe(
    &'a self
) -> Result<EventStream<'a, SubscriptionStream<'a, M::Provider, Log>, D, ContractError<M>>, ContractError<M>>
[src]

Returns a subscription for the event

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

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

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

pub async fn query_with_meta(
    &self
) -> Result<Vec<(D, LogMeta)>, ContractError<M>>
[src]

Queries the blockchain for the selected filter and returns a vector of logs along with their metadata

Trait Implementations

impl<'a: 'b, 'b, M: Debug, D: Debug> Debug for Event<'a, 'b, M, D>[src]

Auto Trait Implementations

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

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

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

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

impl<'a, 'b, M, D> UnwindSafe for Event<'a, 'b, M, D> where
    D: UnwindSafe,
    M: 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> Conv for T

impl<T> FmtForward for T

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

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>,