pub struct TransactionSend<W: WaitLevel = ExecutedOptimistic> { /* private fields */ }Expand description
Future for sending a transaction.
The type parameter W determines the wait level and the return type:
- Executed levels (
crate::types::ExecutedOptimistic,crate::types::Executed,crate::types::Final) →FinalExecutionOutcome - Non-executed levels (
crate::types::Submitted,crate::types::Included,crate::types::IncludedFinal) →crate::types::SendTxResponse
Implementations§
Source§impl<W: WaitLevel> TransactionSend<W>
impl<W: WaitLevel> TransactionSend<W>
Sourcepub fn wait_until<W2: WaitLevel>(self, _level: W2) -> TransactionSend<W2>
pub fn wait_until<W2: WaitLevel>(self, _level: W2) -> TransactionSend<W2>
Change the execution wait level.
The return type changes based on the wait level:
// Executed levels return FinalExecutionOutcome
let outcome = near.transfer("bob.testnet", NearToken::from_near(1))
.send()
.wait_until(Final)
.await?;
// Non-executed levels return SendTxResponse
let response = near.transfer("bob.testnet", NearToken::from_near(1))
.send()
.wait_until(Included)
.await?;Sourcepub fn max_nonce_retries(self, retries: u32) -> Self
pub fn max_nonce_retries(self, retries: u32) -> Self
Override the number of nonce retries for this transaction on InvalidNonce
errors. 0 means no retries (send once), 1 means one retry, etc.
Trait Implementations§
Source§impl<W: WaitLevel> IntoFuture for TransactionSend<W>
impl<W: WaitLevel> IntoFuture for TransactionSend<W>
Source§type Output = Result<<W as WaitLevel>::Response, Error>
type Output = Result<<W as WaitLevel>::Response, Error>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <TransactionSend<W> as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <TransactionSend<W> as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<W> Freeze for TransactionSend<W>
impl<W = ExecutedOptimistic> !RefUnwindSafe for TransactionSend<W>
impl<W> Send for TransactionSend<W>
impl<W> Sync for TransactionSend<W>
impl<W> Unpin for TransactionSend<W>where
W: Unpin,
impl<W> UnsafeUnpin for TransactionSend<W>
impl<W = ExecutedOptimistic> !UnwindSafe for TransactionSend<W>
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