pub enum Extended<BuiltIn, Other> {
BuiltIn(BuiltIn),
Other(Other),
}
Expand description
An enum that combines two different transaction types.
This is intended to be used to extend existing presets, for example the ethereum or opstack transaction types and receipts
Note: The Extended::Other
variants must not overlap with the builtin one, transaction
types must be unique. For example if Extended::BuiltIn
contains an EIP-1559
type variant,
Extended::Other
must not include that type.
Variants§
Implementations§
Source§impl<B, T> Extended<B, T>
impl<B, T> Extended<B, T>
Sourcepub fn convert_builtin<U>(self) -> Extended<U, T>where
U: From<B>,
pub fn convert_builtin<U>(self) -> Extended<U, T>where
U: From<B>,
Converts only the built-in transaction type using From
, leaving the other type unchanged.
Sourcepub fn try_convert_builtin<U>(self) -> Result<Extended<U, T>, U::Error>where
U: TryFrom<B>,
pub fn try_convert_builtin<U>(self) -> Result<Extended<U, T>, U::Error>where
U: TryFrom<B>,
Attempts to convert only the built-in transaction type using TryFrom
, leaving the other
type unchanged.
Sourcepub fn convert_other<U>(self) -> Extended<B, U>where
U: From<T>,
pub fn convert_other<U>(self) -> Extended<B, U>where
U: From<T>,
Converts only the other transaction type using From
, leaving the built-in type unchanged.
Sourcepub fn try_convert_other<U>(self) -> Result<Extended<B, U>, U::Error>where
U: TryFrom<T>,
pub fn try_convert_other<U>(self) -> Result<Extended<B, U>, U::Error>where
U: TryFrom<T>,
Attempts to convert only the other transaction type using TryFrom
, leaving the built-in
type unchanged.
Sourcepub fn map_builtin<U>(self, f: impl FnOnce(B) -> U) -> Extended<U, T>
pub fn map_builtin<U>(self, f: impl FnOnce(B) -> U) -> Extended<U, T>
Maps only the built-in transaction type using the provided function, leaving the other type unchanged.
Sourcepub fn try_map_builtin<U, E>(
self,
f: impl FnOnce(B) -> Result<U, E>,
) -> Result<Extended<U, T>, E>
pub fn try_map_builtin<U, E>( self, f: impl FnOnce(B) -> Result<U, E>, ) -> Result<Extended<U, T>, E>
Attempts to map only the built-in transaction type using the provided fallible function, leaving the other type unchanged. Returns an error if the mapping of the built-in type fails.
Trait Implementations§
Source§impl<B, T> Decodable2718 for Extended<B, T>
impl<B, T> Decodable2718 for Extended<B, T>
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 decode_2718_exact(bytes: &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718_exact(bytes: &[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, BuiltIn, Other> Deserialize<'de> for Extended<BuiltIn, Other>where
BuiltIn: Deserialize<'de>,
Other: Deserialize<'de>,
impl<'de, BuiltIn, Other> Deserialize<'de> for Extended<BuiltIn, Other>where
BuiltIn: Deserialize<'de>,
Other: 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<B, T> Encodable2718 for Extended<B, T>where
B: Encodable2718,
T: Encodable2718,
impl<B, T> Encodable2718 for Extended<B, T>where
B: Encodable2718,
T: Encodable2718,
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 into_encoded(self) -> WithEncoded<Self>
fn into_encoded(self) -> WithEncoded<Self>
WithEncoded
wrapper. Read moreSource§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<Eip4844, Tx> From<EthereumTxEnvelope<Eip4844>> for Extended<EthereumTxEnvelope<Eip4844>, Tx>
impl<Eip4844, Tx> From<EthereumTxEnvelope<Eip4844>> for Extended<EthereumTxEnvelope<Eip4844>, Tx>
Source§fn from(value: EthereumTxEnvelope<Eip4844>) -> Self
fn from(value: EthereumTxEnvelope<Eip4844>) -> Self
Source§impl<B, T> IsTyped2718 for Extended<B, T>where
B: IsTyped2718,
T: IsTyped2718,
impl<B, T> IsTyped2718 for Extended<B, T>where
B: IsTyped2718,
T: IsTyped2718,
Source§impl<B, T> Transaction for Extended<B, T>where
B: Transaction,
T: Transaction,
impl<B, T> Transaction for Extended<B, T>where
B: Transaction,
T: Transaction,
Source§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
Source§fn max_priority_fee_per_gas(&self) -> Option<u128>
fn max_priority_fee_per_gas(&self) -> Option<u128>
Source§fn max_fee_per_blob_gas(&self) -> Option<u128>
fn max_fee_per_blob_gas(&self) -> Option<u128>
Source§fn priority_fee_or_price(&self) -> u128
fn priority_fee_or_price(&self) -> u128
Source§fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
Source§fn is_dynamic_fee(&self) -> bool
fn is_dynamic_fee(&self) -> bool
true
if the transaction supports dynamic fees.Source§fn is_create(&self) -> bool
fn is_create(&self) -> bool
kind
as it copies the 21-byte
TxKind
for this simple check. A proper implementation shouldn’t allocate.Source§fn access_list(&self) -> Option<&AccessList>
fn access_list(&self) -> Option<&AccessList>
access_list
for the particular transaction type. Returns None
for
older transaction types.Source§fn blob_versioned_hashes(&self) -> Option<&[B256]>
fn blob_versioned_hashes(&self) -> Option<&[B256]>
None
.SignedAuthorization
list of the transaction. Read moreSource§fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
Source§fn to(&self) -> Option<Address>
fn to(&self) -> Option<Address>
Source§fn function_selector(&self) -> Option<&Selector>
fn function_selector(&self) -> Option<&Selector>
Source§fn blob_count(&self) -> Option<u64>
fn blob_count(&self) -> Option<u64>
Source§fn blob_gas_used(&self) -> Option<u64>
fn blob_gas_used(&self) -> Option<u64>
SignedAuthorization
in this transactions Read moreSource§impl<B, T> Typed2718 for Extended<B, T>
impl<B, T> Typed2718 for Extended<B, T>
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<BuiltIn: Eq, Other: Eq> Eq for Extended<BuiltIn, Other>
impl<BuiltIn, Other> StructuralPartialEq for Extended<BuiltIn, Other>
Auto Trait Implementations§
impl<BuiltIn, Other> Freeze for Extended<BuiltIn, Other>
impl<BuiltIn, Other> RefUnwindSafe for Extended<BuiltIn, Other>where
BuiltIn: RefUnwindSafe,
Other: RefUnwindSafe,
impl<BuiltIn, Other> Send for Extended<BuiltIn, Other>
impl<BuiltIn, Other> Sync for Extended<BuiltIn, Other>
impl<BuiltIn, Other> Unpin for Extended<BuiltIn, Other>
impl<BuiltIn, Other> UnwindSafe for Extended<BuiltIn, Other>where
BuiltIn: UnwindSafe,
Other: 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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 more