pub enum SendableTx<N: Network> {
Builder(N::TransactionRequest),
Envelope(N::TxEnvelope),
}
Expand description
A transaction that can be sent. This is either a builder or an envelope.
This type is used to allow for fillers to convert a builder into an envelope without changing the user-facing API.
Users should NOT use this type directly. It should only be used as an
implementation detail of Provider::send_transaction_internal
.
Variants§
Builder(N::TransactionRequest)
A transaction that is not yet signed.
Envelope(N::TxEnvelope)
A transaction that is signed and fully constructed.
Implementations§
Source§impl<N: Network> SendableTx<N>
impl<N: Network> SendableTx<N>
Sourcepub const fn as_mut_builder(&mut self) -> Option<&mut N::TransactionRequest>
pub const fn as_mut_builder(&mut self) -> Option<&mut N::TransactionRequest>
Fallible cast to an unbuilt transaction request.
Sourcepub const fn as_builder(&self) -> Option<&N::TransactionRequest>
pub const fn as_builder(&self) -> Option<&N::TransactionRequest>
Fallible cast to an unbuilt transaction request.
Sourcepub const fn is_builder(&self) -> bool
pub const fn is_builder(&self) -> bool
Checks if the transaction is a builder.
Sourcepub const fn is_envelope(&self) -> bool
pub const fn is_envelope(&self) -> bool
Check if the transaction is an envelope.
Sourcepub const fn as_envelope(&self) -> Option<&N::TxEnvelope>
pub const fn as_envelope(&self) -> Option<&N::TxEnvelope>
Fallible cast to a built transaction envelope.
Sourcepub fn try_into_envelope(
self,
) -> Result<N::TxEnvelope, SendableTxErr<N::TransactionRequest>>
pub fn try_into_envelope( self, ) -> Result<N::TxEnvelope, SendableTxErr<N::TransactionRequest>>
Returns the envelope if this variant is an SendableTx::Envelope
.
Returns a SendableTxErr
with the request object otherwise.
Sourcepub fn try_into_request(
self,
) -> Result<N::TransactionRequest, SendableTxErr<N::TxEnvelope>>
pub fn try_into_request( self, ) -> Result<N::TransactionRequest, SendableTxErr<N::TxEnvelope>>
Returns the envelope if this variant is an SendableTx::Builder
.
Returns a SendableTxErr
with the request object otherwise.
Trait Implementations§
Source§impl<N: Clone + Network> Clone for SendableTx<N>
impl<N: Clone + Network> Clone for SendableTx<N>
Source§fn clone(&self) -> SendableTx<N>
fn clone(&self) -> SendableTx<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl<N: Eq + Network> Eq for SendableTx<N>
impl<N: Network> StructuralPartialEq for SendableTx<N>
Auto Trait Implementations§
impl<N> Freeze for SendableTx<N>
impl<N> RefUnwindSafe for SendableTx<N>
impl<N> Send for SendableTx<N>
impl<N> Sync for SendableTx<N>
impl<N> Unpin for SendableTx<N>
impl<N> UnwindSafe for SendableTx<N>
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<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 more