pub struct Resp<M: Message> { /* private fields */ }
Expand description
The Resp
Implementations§
source§impl<M: Message> Resp<M>
impl<M: Message> Resp<M>
sourcepub fn with_stream_from_buffer(self, b: Bytes) -> Self
pub fn with_stream_from_buffer(self, b: Bytes) -> Self
Attach a stream to message in response, where the stream is streamed
from a fixed Bytes
buffer
sourcepub fn with_stream(self, b: ByteStream) -> Self
pub fn with_stream(self, b: ByteStream) -> Self
Attach a stream to message in response, where the stream is
an instance of ByteStream
.
sourcepub fn with_order_tag(self, order_tag: OrderTag) -> Self
pub fn with_order_tag(self, order_tag: OrderTag) -> Self
Add an order tag to this response to indicate in which order it should be sent.
sourcepub fn msg(&self) -> &M::Response
pub fn msg(&self) -> &M::Response
Get a reference to the response message contained in this request
sourcepub fn into_msg(self) -> M::Response
pub fn into_msg(self) -> M::Response
Transforms the Resp<M>
into the response message it contains,
dropping everything else (including attached data stream)
sourcepub fn into_parts(self) -> (M::Response, Option<ByteStream>)
pub fn into_parts(self) -> (M::Response, Option<ByteStream>)
Transforms the Resp<M>
into, on the one side, the response message
it contains, and on the other side, the associated data stream
if it exists
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Resp<M>
impl<M> Send for Resp<M>
impl<M> Sync for Resp<M>
impl<M> Unpin for Resp<M>where M: Unpin, <M as Message>::Response: Unpin,
impl<M> !UnwindSafe for Resp<M>
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