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.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for BatchBuilder<C>
impl<C> !UnwindSafe for BatchBuilder<C>
impl<C> Freeze for BatchBuilder<C>where
C: Freeze,
impl<C> Send for BatchBuilder<C>where
C: Send,
impl<C> Sync for BatchBuilder<C>where
C: Sync,
impl<C> Unpin for BatchBuilder<C>where
C: Unpin,
impl<C> UnsafeUnpin for BatchBuilder<C>where
C: UnsafeUnpin,
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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