Struct ethcontract::contract::Event
source · pub struct Event<T> {
pub data: T,
pub meta: Option<EventMetadata>,
}Expand description
A contract event
Fields§
§data: TThe decoded log data.
meta: Option<EventMetadata>The additional metadata for the event. Note that this is not always
available if these logs are pending. This can happen if the to_block
option was set to BlockNumber::Pending.
Implementations§
source§impl<T> Event<EventStatus<T>>
impl<T> Event<EventStatus<T>>
sourcepub fn inner_data(&self) -> &T
pub fn inner_data(&self) -> &T
Get a reference the underlying event data regardless of whether the event was added or removed.
sourcepub fn is_removed(&self) -> bool
pub fn is_removed(&self) -> bool
Gets a bool representing if the event was removed.
sourcepub fn added(self) -> Option<T>
pub fn added(self) -> Option<T>
Get the underlying event data if the event was added, None otherwise.
sourcepub fn removed(self) -> Option<T>
pub fn removed(self) -> Option<T>
Get the underlying event data if the event was removed, None
otherwise.
sourcepub fn map<U, F>(self, f: F) -> StreamEvent<U>where
F: FnOnce(T) -> U,
pub fn map<U, F>(self, f: F) -> StreamEvent<U>where
F: FnOnce(T) -> U,
Maps the inner data of an event into some other data.
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Event<T>
impl<T: PartialEq> PartialEq for Event<T>
impl<T: Eq> Eq for Event<T>
impl<T> StructuralPartialEq for Event<T>
Auto Trait Implementations§
impl<T> Freeze for Event<T>where
T: Freeze,
impl<T> RefUnwindSafe for Event<T>where
T: RefUnwindSafe,
impl<T> Send for Event<T>where
T: Send,
impl<T> Sync for Event<T>where
T: Sync,
impl<T> Unpin for Event<T>where
T: Unpin,
impl<T> UnwindSafe for Event<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.