pub struct BatchClient { /* private fields */ }
Expand description
A client that wraps an RpcClient
and uses it to submit batches of transactions.
Implementations§
Source§impl BatchClient
impl BatchClient
Sourcepub async fn new(
rpc_client: Arc<RpcClient>,
signers: Vec<Arc<Keypair>>,
) -> Result<Self, Error>
pub async fn new( rpc_client: Arc<RpcClient>, signers: Vec<Arc<Keypair>>, ) -> Result<Self, Error>
Creates a new BatchClient
, and spawns the associated background tasks. The background
tasks will run until the BatchClient
is dropped.
Sourcepub async fn send<T>(
&self,
messages: Vec<(T, Message)>,
timeout: Option<Duration>,
) -> Vec<TransactionOutcome<T>>
pub async fn send<T>( &self, messages: Vec<(T, Message)>, timeout: Option<Duration>, ) -> Vec<TransactionOutcome<T>>
Queue a batch of transactions to be sent to the network. An attempt will be made to submit the transactions in the provided order, they can be reordered, especially in case of re-submissions. The client will re-submit the transactions until they are successfully confirmed or the timeout is reached, if one is provided.
Cancel safety: Dropping the future returned by this method will stop any further re-submissions of the provided transactions, but makes no guarantees about the number of transactions that have already been submitted or confirmed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BatchClient
impl RefUnwindSafe for BatchClient
impl Send for BatchClient
impl Sync for BatchClient
impl Unpin for BatchClient
impl UnwindSafe for BatchClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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