pub struct BatchResponseBuilder { /* private fields */ }Available on crate feature
server only.Expand description
Builder for the response to a batch request.
Implementations§
Source§impl BatchResponseBuilder
impl BatchResponseBuilder
Sourcepub fn new_with_limit(limit: usize) -> Self
pub fn new_with_limit(limit: usize) -> Self
Create a new batch response builder with limit.
Sourcepub fn append(&mut self, response: MethodResponse) -> Result<(), MethodResponse>
pub fn append(&mut self, response: MethodResponse) -> Result<(), MethodResponse>
Append a result from an individual method to the batch response.
Fails if the max limit is exceeded and returns to error response to return early in order to not process method call responses which are thrown away anyway.
Sourcepub fn finish(self) -> MethodResponse
pub fn finish(self) -> MethodResponse
Finish the batch response.
An empty batch is answered with an invalid request error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BatchResponseBuilder
impl RefUnwindSafe for BatchResponseBuilder
impl Send for BatchResponseBuilder
impl Sync for BatchResponseBuilder
impl Unpin for BatchResponseBuilder
impl UnsafeUnpin for BatchResponseBuilder
impl UnwindSafe for BatchResponseBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes