Struct netapp::message::Resp

source ·
pub struct Resp<M: Message> { /* private fields */ }
Expand description

The Resp represents a full response from a RPC that may have an attached stream.

Implementations§

source§

impl<M: Message> Resp<M>

source

pub fn new(v: M::Response) -> Self

Creates a new response from a base response message

source

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

source

pub fn with_stream(self, b: ByteStream) -> Self

Attach a stream to message in response, where the stream is an instance of ByteStream.

source

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.

source

pub fn msg(&self) -> &M::Response

Get a reference to the response message contained in this request

source

pub fn into_msg(self) -> M::Response

Transforms the Resp<M> into the response message it contains, dropping everything else (including attached data stream)

source

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§

source§

impl<M> Debug for Resp<M>where M: Message, <M as Message>::Response: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V