pub struct Log<T = LogData> {
pub inner: Log<T>,
pub block_hash: Option<FixedBytes<32>>,
pub block_number: Option<u64>,
pub block_timestamp: Option<u64>,
pub transaction_hash: Option<FixedBytes<32>>,
pub transaction_index: Option<u64>,
pub log_index: Option<u64>,
pub removed: bool,
}
eth
only.Expand description
Ethereum Log emitted by a transaction
Fields§
§inner: Log<T>
Consensus log object
block_hash: Option<FixedBytes<32>>
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>
The timestamp of the block as proposed in: https://ethereum-magicians.org/t/proposal-for-adding-blocktimestamp-to-logs-object-returned-by-eth-getlogs-and-related-requests https://github.com/ethereum/execution-apis/issues/295
transaction_hash: Option<FixedBytes<32>>
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 Log
impl Log
Sourcepub fn topics(&self) -> &[FixedBytes<32>]
pub fn topics(&self) -> &[FixedBytes<32>]
Getter for the topics field. Shortcut for log.inner.topics()
.
Sourcepub fn topic0(&self) -> Option<&FixedBytes<32>>
pub fn topic0(&self) -> Option<&FixedBytes<32>>
Getter for the topic0 field.
Sourcepub fn topics_mut(&mut self) -> &mut [FixedBytes<32>]
pub fn topics_mut(&mut self) -> &mut [FixedBytes<32>]
Get the topic list, mutably. This gives access to the internal
array, without allowing extension of that array. Shortcut for
LogData::topics_mut
Source§impl<T> Log<T>
impl<T> Log<T>
Sourcepub fn reserialize_inner(&self) -> Log
pub fn reserialize_inner(&self) -> Log
Reserialize the inner data, returning an alloy_primitives::Log
.
Sourcepub fn reserialize(&self) -> Log
pub fn reserialize(&self) -> Log
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> for Log<T>where
T: Arbitrary<'arbitrary>,
impl<'arbitrary, T> Arbitrary<'arbitrary> for Log<T>where
T: Arbitrary<'arbitrary>,
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Log<T>, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Log<T>, Error>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Log<T>, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Log<T>, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl<'de, T> Deserialize<'de> for Log<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Log<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Log<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Log<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<T> Serialize for Log<T>where
T: Serialize,
impl<T> Serialize for Log<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<T> Eq for Log<T>where
T: Eq,
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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