pub struct TransactionType(/* private fields */);Expand description
EIP-2718 transaction envelope type.
Implementations§
Source§impl TransactionType
impl TransactionType
Sourcepub const LEGACY: Self
pub const LEGACY: Self
Legacy transaction type used by APIs that need an explicit domain value.
Sourcepub const fn try_new_typed(value: u8) -> Result<Self, PrimitiveError>
pub const fn try_new_typed(value: u8) -> Result<Self, PrimitiveError>
Creates a typed EIP-2718 transaction type.
0 is reserved for the legacy transaction domain. Encoders must handle
legacy transactions separately instead of prepending a zero type byte.
Sourcepub const fn try_new_with_legacy(value: u8) -> Result<Self, PrimitiveError>
pub const fn try_new_with_legacy(value: u8) -> Result<Self, PrimitiveError>
Creates a transaction type and accepts the legacy domain marker.
Use this when an API explicitly accepts both legacy and typed
transaction domains. Use Self::try_new_typed when parsing an
EIP-2718 typed-envelope byte.
Trait Implementations§
Source§impl Clone for TransactionType
impl Clone for TransactionType
Source§fn clone(&self) -> TransactionType
fn clone(&self) -> TransactionType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TransactionType
Source§impl Debug for TransactionType
impl Debug for TransactionType
impl Eq for TransactionType
Source§impl From<TransactionType> for u8
impl From<TransactionType> for u8
Source§fn from(value: TransactionType) -> Self
fn from(value: TransactionType) -> Self
Converts to this type from the input type.
Source§impl Hash for TransactionType
impl Hash for TransactionType
Source§impl Ord for TransactionType
impl Ord for TransactionType
Source§fn cmp(&self, other: &TransactionType) -> Ordering
fn cmp(&self, other: &TransactionType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TransactionType
impl PartialEq for TransactionType
Source§fn eq(&self, other: &TransactionType) -> bool
fn eq(&self, other: &TransactionType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TransactionType
impl PartialOrd for TransactionType
impl StructuralPartialEq for TransactionType
Source§impl TryFrom<u8> for TransactionType
impl TryFrom<u8> for TransactionType
Source§fn try_from(value: u8) -> Result<Self, Self::Error>
fn try_from(value: u8) -> Result<Self, Self::Error>
Parses a typed EIP-2718 transaction type byte.
Rejects 0 because it belongs to the legacy transaction domain. Use
TransactionType::try_new_with_legacy when the caller explicitly
accepts both legacy and typed transaction domains.
Source§type Error = PrimitiveError
type Error = PrimitiveError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for TransactionType
impl RefUnwindSafe for TransactionType
impl Send for TransactionType
impl Sync for TransactionType
impl Unpin for TransactionType
impl UnsafeUnpin for TransactionType
impl UnwindSafe for TransactionType
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