Struct alloy_rpc_types_eth::log::Log

source ·
pub struct Log<T = LogData> {
    pub inner: Log<T>,
    pub block_hash: Option<BlockHash>,
    pub block_number: Option<u64>,
    pub block_timestamp: Option<u64>,
    pub transaction_hash: Option<TxHash>,
    pub transaction_index: Option<u64>,
    pub log_index: Option<u64>,
    pub removed: bool,
}
Expand description

Ethereum Log emitted by a transaction

Fields§

§inner: Log<T>

Consensus log object

§block_hash: Option<BlockHash>

Hash of the block the transaction that emitted this log was mined in

§block_number: Option<u64>

Number of the block the transaction that emitted this log was mined in

§block_timestamp: Option<u64>§transaction_hash: Option<TxHash>

Transaction Hash

§transaction_index: Option<u64>

Index of the Transaction in the block

§log_index: Option<u64>

Log Index in Block

§removed: bool

Geth Compatibility Field: whether this log was removed

Implementations§

source§

impl<T> Log<T>

source

pub const fn address(&self) -> Address

Getter for the address field. Shortcut for log.inner.address.

source

pub const fn data(&self) -> &T

Getter for the data field. Shortcut for log.inner.data.

source§

impl Log<LogData>

source

pub fn topics(&self) -> &[B256]

Getter for the topics field. Shortcut for log.inner.topics().

source

pub fn topic0(&self) -> Option<&B256>

Getter for the topic0 field.

source

pub fn topics_mut(&mut self) -> &mut [B256]

Get the topic list, mutably. This gives access to the internal array, without allowing extension of that array. Shortcut for [LogData::topics_mut]

source

pub fn log_decode<T: SolEvent>(&self) -> Result<Log<T>>

Decode the log data into a typed log.

source§

impl<T> Log<T>
where for<'a> &'a T: Into<LogData>,

source

pub fn reserialize_inner(&self) -> Log

Reserialize the inner data, returning an [alloy_primitives::Log].

source

pub fn reserialize(&self) -> Log<LogData>

Reserialize the data, returning a new Log object wrapping an [alloy_primitives::Log]. this copies the log metadata, preserving the original object.

Trait Implementations§

source§

impl<'arbitrary, T: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for Log<T>

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl<T: Arbitrary> Arbitrary for Log<T>

§

type Parameters = (<Log<T> as Arbitrary>::Parameters, <Option<FixedBytes<32>> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <Option<FixedBytes<32>> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <bool as Arbitrary>::Parameters)

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = Map<(<Log<T> as Arbitrary>::Strategy, <Option<FixedBytes<32>> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <Option<FixedBytes<32>> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <bool as Arbitrary>::Strategy), fn(_: (Log<T>, Option<FixedBytes<32>>, Option<u64>, Option<u64>, Option<FixedBytes<32>>, Option<u64>, Option<u64>, bool)) -> Log<T>>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl<T> AsMut<Log<T>> for Log<T>

source§

fn as_mut(&mut self) -> &mut Log<T>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<T> for Log<T>

source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<Log<T>> for Log<T>

source§

fn as_ref(&self) -> &Log<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<T> for Log<T>

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Clone> Clone for Log<T>

source§

fn clone(&self) -> Log<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Log<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default> Default for Log<T>

source§

fn default() -> Log<T>

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for Log<T>
where T: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Encodable for Log<T>
where for<'a> &'a T: Into<LogData>,

source§

fn encode(&self, out: &mut dyn BufMut)

Encodes the type into the out buffer.
source§

fn length(&self) -> usize

Returns the length of the encoding of this type in bytes. Read more
source§

impl<T: Hash> Hash for Log<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: PartialEq> PartialEq for Log<T>

source§

fn eq(&self, other: &Log<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Serialize for Log<T>
where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Eq> Eq for Log<T>

source§

impl<T> StructuralPartialEq for Log<T>

Auto Trait Implementations§

§

impl<T> Freeze for Log<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Log<T>
where T: RefUnwindSafe,

§

impl<T> Send for Log<T>
where T: Send,

§

impl<T> Sync for Log<T>
where T: Sync,

§

impl<T> Unpin for Log<T>
where T: Unpin,

§

impl<T> UnwindSafe for Log<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.