pub struct ResponseBuilder<TResp>where
TResp: PayloadSerialize,{ /* private fields */ }
Expand description
Builder for Response
.
Implementations§
Source§impl<TResp> ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
impl<TResp> ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
Source§impl<TResp: PayloadSerialize> ResponseBuilder<TResp>
impl<TResp: PayloadSerialize> ResponseBuilder<TResp>
Sourcepub fn payload(&mut self, payload: TResp) -> Result<&mut Self, AIOProtocolError>
pub fn payload(&mut self, payload: TResp) -> Result<&mut Self, AIOProtocolError>
Add a payload to the command response. Validates successful serialization of the payload.
§Errors
AIOProtocolError
of kind PayloadInvalid
if serialization of the payload fails
AIOProtocolError
of kind ConfigurationInvalid
if the content type is not valid utf-8
Trait Implementations§
Source§impl<TResp> Clone for ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
impl<TResp> Clone for ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
Source§fn clone(&self) -> ResponseBuilder<TResp>
fn clone(&self) -> ResponseBuilder<TResp>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<TResp> Default for ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
impl<TResp> Default for ResponseBuilder<TResp>where
TResp: PayloadSerialize + Clone,
Auto Trait Implementations§
impl<TResp> Freeze for ResponseBuilder<TResp>
impl<TResp> RefUnwindSafe for ResponseBuilder<TResp>where
TResp: RefUnwindSafe,
impl<TResp> Send for ResponseBuilder<TResp>where
TResp: Send,
impl<TResp> Sync for ResponseBuilder<TResp>where
TResp: Sync,
impl<TResp> Unpin for ResponseBuilder<TResp>where
TResp: Unpin,
impl<TResp> UnwindSafe for ResponseBuilder<TResp>where
TResp: UnwindSafe,
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