pub enum ReceiptEnvelope<T = Log> {
Legacy(ReceiptWithBloom<Receipt<T>>),
Eip2930(ReceiptWithBloom<Receipt<T>>),
Eip1559(ReceiptWithBloom<Receipt<T>>),
Eip4844(ReceiptWithBloom<Receipt<T>>),
Eip7702(ReceiptWithBloom<Receipt<T>>),
}
Expand description
Receipt envelope, as defined in EIP-2718.
This enum distinguishes between tagged and untagged legacy receipts, as the
in-protocol Merkle tree may commit to EITHER 0-prefixed or raw. Therefore
we must ensure that encoding returns the precise byte-array that was
decoded, preserving the presence or absence of the TransactionType
flag.
Transaction receipt payloads are specified in their respective EIPs.
Variants§
Legacy(ReceiptWithBloom<Receipt<T>>)
Receipt envelope with no type flag.
Eip2930(ReceiptWithBloom<Receipt<T>>)
Receipt envelope with type flag 1, containing a EIP-2930 receipt.
Eip1559(ReceiptWithBloom<Receipt<T>>)
Receipt envelope with type flag 2, containing a EIP-1559 receipt.
Eip4844(ReceiptWithBloom<Receipt<T>>)
Receipt envelope with type flag 2, containing a EIP-4844 receipt.
Eip7702(ReceiptWithBloom<Receipt<T>>)
Receipt envelope with type flag 4, containing a EIP-7702 receipt.
Implementations§
Source§impl<T> ReceiptEnvelope<T>
impl<T> ReceiptEnvelope<T>
Sourcepub fn map_logs<U>(self, f: impl FnMut(T) -> U) -> ReceiptEnvelope<U>
pub fn map_logs<U>(self, f: impl FnMut(T) -> U) -> ReceiptEnvelope<U>
Converts the receipt’s log type by applying a function to each log.
Returns the receipt with the new log type.
Sourcepub fn into_primitives_receipt(self) -> ReceiptEnvelope<Log>
pub fn into_primitives_receipt(self) -> ReceiptEnvelope<Log>
Converts a ReceiptEnvelope
with a custom log type into a ReceiptEnvelope
with the
primitives Log
type by converting the logs.
This is useful if log types that embed the primitives log type, e.g. the log receipt rpc type.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Return true if the transaction was successful.
Sourcepub fn cumulative_gas_used(&self) -> u64
pub fn cumulative_gas_used(&self) -> u64
Returns the cumulative gas used at this receipt.
Sourcepub fn logs_bloom(&self) -> &Bloom
pub fn logs_bloom(&self) -> &Bloom
Return the receipt’s bloom.
Sourcepub const fn as_receipt_with_bloom(
&self,
) -> Option<&ReceiptWithBloom<Receipt<T>>>
pub const fn as_receipt_with_bloom( &self, ) -> Option<&ReceiptWithBloom<Receipt<T>>>
Return the inner receipt with bloom. Currently this is infallible, however, future receipt types may be added.
Sourcepub fn as_receipt_with_bloom_mut(
&mut self,
) -> Option<&mut ReceiptWithBloom<Receipt<T>>>
pub fn as_receipt_with_bloom_mut( &mut self, ) -> Option<&mut ReceiptWithBloom<Receipt<T>>>
Return the mutable inner receipt with bloom. Currently this is infallible, however, future receipt types may be added.
Sourcepub const fn as_receipt(&self) -> Option<&Receipt<T>>
pub const fn as_receipt(&self) -> Option<&Receipt<T>>
Return the inner receipt. Currently this is infallible, however, future receipt types may be added.
Source§impl ReceiptEnvelope
impl ReceiptEnvelope
Sourcepub fn inner_length(&self) -> usize
pub fn inner_length(&self) -> usize
Get the length of the inner receipt in the 2718 encoding.
Sourcepub fn rlp_payload_length(&self) -> usize
pub fn rlp_payload_length(&self) -> usize
Calculate the length of the rlp payload of the network encoded receipt.
Trait Implementations§
Source§impl<'a, T> Arbitrary<'a> for ReceiptEnvelope<T>where
T: Arbitrary<'a>,
Available on crate feature arbitrary
only.
impl<'a, T> Arbitrary<'a> for ReceiptEnvelope<T>where
T: Arbitrary<'a>,
arbitrary
only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, 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<T: Clone> Clone for ReceiptEnvelope<T>
impl<T: Clone> Clone for ReceiptEnvelope<T>
Source§fn clone(&self) -> ReceiptEnvelope<T>
fn clone(&self) -> ReceiptEnvelope<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for ReceiptEnvelope<T>
impl<T: Debug> Debug for ReceiptEnvelope<T>
Source§impl Decodable for ReceiptEnvelope
impl Decodable for ReceiptEnvelope
Source§impl Decodable2718 for ReceiptEnvelope
impl Decodable2718 for ReceiptEnvelope
Source§fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
Source§fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
Source§fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
Source§fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
Source§fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
Source§impl<'de, T> Deserialize<'de> for ReceiptEnvelope<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ReceiptEnvelope<T>where
T: Deserialize<'de>,
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>,
Source§impl Encodable for ReceiptEnvelope
impl Encodable for ReceiptEnvelope
Source§impl Encodable2718 for ReceiptEnvelope
impl Encodable2718 for ReceiptEnvelope
Source§fn encode_2718_len(&self) -> usize
fn encode_2718_len(&self) -> usize
Source§fn encode_2718(&self, out: &mut dyn BufMut)
fn encode_2718(&self, out: &mut dyn BufMut)
Source§fn encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
Source§fn trie_hash(&self) -> FixedBytes<32>
fn trie_hash(&self) -> FixedBytes<32>
Source§fn network_len(&self) -> usize
fn network_len(&self) -> usize
Source§fn network_encode(&self, out: &mut dyn BufMut)
fn network_encode(&self, out: &mut dyn BufMut)
Source§impl<T: PartialEq> PartialEq for ReceiptEnvelope<T>
impl<T: PartialEq> PartialEq for ReceiptEnvelope<T>
Source§impl<T> Serialize for ReceiptEnvelope<T>where
T: Serialize,
impl<T> Serialize for ReceiptEnvelope<T>where
T: Serialize,
Source§impl<T> TxReceipt for ReceiptEnvelope<T>
impl<T> TxReceipt for ReceiptEnvelope<T>
Source§fn cumulative_gas_used(&self) -> u64
fn cumulative_gas_used(&self) -> u64
Returns the cumulative gas used at this receipt.
Source§fn status_or_post_state(&self) -> Eip658Value
fn status_or_post_state(&self) -> Eip658Value
Source§fn bloom_cheap(&self) -> Option<Bloom>
fn bloom_cheap(&self) -> Option<Bloom>
Source§fn with_bloom_ref(&self) -> ReceiptWithBloom<&Self>
fn with_bloom_ref(&self) -> ReceiptWithBloom<&Self>
ReceiptWithBloom
with the computed bloom filter Self::bloom
and a reference
to the receipt.Source§fn into_with_bloom(self) -> ReceiptWithBloom<Self>
fn into_with_bloom(self) -> ReceiptWithBloom<Self>
ReceiptWithBloom
with the computed bloom filter
Self::bloom
and the receipt.Source§impl Typed2718 for ReceiptEnvelope
impl Typed2718 for ReceiptEnvelope
Source§fn is_eip2930(&self) -> bool
fn is_eip2930(&self) -> bool
Source§fn is_eip1559(&self) -> bool
fn is_eip1559(&self) -> bool
Source§fn is_eip4844(&self) -> bool
fn is_eip4844(&self) -> bool
Source§fn is_eip7702(&self) -> bool
fn is_eip7702(&self) -> bool
impl<T: Eq> Eq for ReceiptEnvelope<T>
impl<T> StructuralPartialEq for ReceiptEnvelope<T>
Auto Trait Implementations§
impl<T> Freeze for ReceiptEnvelope<T>
impl<T> RefUnwindSafe for ReceiptEnvelope<T>where
T: RefUnwindSafe,
impl<T> Send for ReceiptEnvelope<T>where
T: Send,
impl<T> Sync for ReceiptEnvelope<T>where
T: Sync,
impl<T> Unpin for ReceiptEnvelope<T>where
T: Unpin,
impl<T> UnwindSafe for ReceiptEnvelope<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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Eip2718Envelope for Twhere
T: Decodable2718 + Encodable2718,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 336 bytes
Size for each variant:
Legacy
: 328 bytesEip2930
: 328 bytesEip1559
: 328 bytesEip4844
: 328 bytesEip7702
: 328 bytes