pub struct DecodedEvent {
pub chain: ChainId,
pub schema: String,
pub schema_version: u32,
pub tx_hash: String,
pub block_number: u64,
pub block_timestamp: i64,
pub log_index: u32,
pub address: String,
pub fields: HashMap<String, NormalizedValue>,
pub fingerprint: EventFingerprint,
pub decode_errors: HashMap<String, String>,
}Expand description
A fully decoded event — the primary output of ChainCodec.
Fields§
§chain: ChainIdThe chain this event came from
schema: StringMatched schema name, e.g. “UniswapV3Swap”
schema_version: u32Schema version that was used to decode this event
tx_hash: StringTransaction hash
block_number: u64Block number
block_timestamp: i64Block timestamp (Unix seconds)
log_index: u32Log index
address: StringContract address
fields: HashMap<String, NormalizedValue>Decoded, normalized field values keyed by field name
fingerprint: EventFingerprintThe fingerprint used to match this event
decode_errors: HashMap<String, String>Optional: fields that failed to decode (only present in lenient mode)
Implementations§
Source§impl DecodedEvent
impl DecodedEvent
Sourcepub fn field(&self, name: &str) -> Option<&NormalizedValue>
pub fn field(&self, name: &str) -> Option<&NormalizedValue>
Get a field value by name.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true if any fields failed to decode.
Trait Implementations§
Source§impl Clone for DecodedEvent
impl Clone for DecodedEvent
Source§fn clone(&self) -> DecodedEvent
fn clone(&self) -> DecodedEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DecodedEvent
impl Debug for DecodedEvent
Source§impl<'de> Deserialize<'de> for DecodedEvent
impl<'de> Deserialize<'de> for DecodedEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DecodedEvent
impl RefUnwindSafe for DecodedEvent
impl Send for DecodedEvent
impl Sync for DecodedEvent
impl Unpin for DecodedEvent
impl UnsafeUnpin for DecodedEvent
impl UnwindSafe for DecodedEvent
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