pub struct BatchBuilder<C> { /* private fields */ }Expand description
Accumulates queued [BatchableCall]s into a single
POST /rpc/batch round-trip. Build via RpcClient::batch_builder
or the macro-generated Client::batch().
Send-on-drop is intentionally not implemented — the batch only
fires when you call .send().await. Drops without sending are
silent (queued calls just discarded).
Implementations§
Source§impl<C> BatchBuilder<C>
impl<C> BatchBuilder<C>
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of queued frames (including ones whose input failed
to encode — those still consume an id and will surface their
error on the matching take).
pub fn is_empty(&self) -> bool
Sourcepub async fn send(self) -> Result<BatchResults, RpcClientError>
pub async fn send(self) -> Result<BatchResults, RpcClientError>
Fire the batch as a single POST /rpc/batch and return a
BatchResults keyed by handle for per-op output extraction.
The outer Result only fails on transport / batch-envelope
errors (the whole batch couldn’t be sent or the response
couldn’t be parsed). Per-frame failures — both pre-send input
encoding errors and server-side RpcErrorBody — are deferred
to the matching BatchResults::take(handle)? call.