Struct alloy_consensus::transaction::Recovered

source ·
pub struct Recovered<T> { /* private fields */ }
Expand description

Signed transaction with recovered signer.

Implementations§

source§

impl<T> Recovered<T>

source

pub const fn signer(&self) -> Address

Signer of transaction recovered from signature

source

pub const fn signer_ref(&self) -> &Address

Reference to the signer of transaction recovered from signature

source

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

Returns a reference to the transaction.

source

pub fn into_tx(self) -> T

Transform back to the transaction.

source

pub fn clone_tx(&self) -> T
where T: Clone,

Clone the inner transaction.

source

pub fn into_parts(self) -> (T, Address)

Dissolve Self to its component

source

pub const fn new_unchecked(tx: T, signer: Address) -> Self

Create Recovered from the given transaction and Address of the signer.

Note: This does not check if the signer is the actual signer of the transaction.

source

pub fn map_transaction<Tx>(self, f: impl FnOnce(T) -> Tx) -> Recovered<Tx>

Applies the given closure to the inner transactions.

Trait Implementations§

source§

impl<T> AsRef<T> for Recovered<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 Recovered<T>

source§

fn clone(&self) -> Recovered<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 Recovered<T>

source§

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

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

impl<T: Decodable + SignerRecoverable> Decodable for Recovered<T>

source§

fn decode(buf: &mut &[u8]) -> Result<Self>

Decodes the blob into the appropriate type. buf must be advanced past the decoded object.
source§

impl<T> Deref for Recovered<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T: Encodable> Encodable for Recovered<T>

source§

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

This encodes the transaction with the signature, and an rlp header.

source§

fn length(&self) -> usize

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

impl<T: Encodable2718> Encodable2718 for Recovered<T>

source§

fn type_flag(&self) -> Option<u8>

Return the type flag (if any). Read more
source§

fn encode_2718_len(&self) -> usize

The length of the 2718 encoded envelope. This is the length of the type flag + the length of the inner encoding.
source§

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

Encode the transaction according to EIP-2718 rules. First a 1-byte type flag in the range 0x0-0x7f, then the body of the transaction. Read more
source§

fn trie_hash(&self) -> B256

Compute the hash as committed to in the MPT trie. This hash is used ONLY by the Ethereum merkle-patricia trie and associated proofs. Do not call this method unless you are building a full or light client. Read more
source§

fn is_legacy(&self) -> bool

True if the envelope is the legacy variant.
source§

fn encoded_2718(&self) -> Vec<u8>

Encode the transaction according to [EIP-2718] rules. First a 1-byte type flag in the range 0x0-0x7f, then the body of the transaction. Read more
source§

fn seal(self) -> Sealed<Self>

Seal the encodable, by encoding and hashing it.
source§

fn network_len(&self) -> usize

The length of the 2718 encoded envelope in network format. This is the length of the header + the length of the type flag and inner encoding.
source§

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

Encode in the network format. The network format is used ONLY by the Ethereum p2p protocol. Do not call this method unless you are building a p2p protocol client. Read more
source§

impl<T: Hash> Hash for Recovered<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 Recovered<T>

source§

fn eq(&self, other: &Recovered<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: Eq> Eq for Recovered<T>

source§

impl<T> StructuralPartialEq for Recovered<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Recovered<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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more