tokio_proto::streaming

Enum Message

Source
pub enum Message<T, B> {
    WithoutBody(T),
    WithBody(T, B),
}
Expand description

Message sent and received from a multiplexed service

Variants§

§

WithoutBody(T)

Has no associated streaming body

§

WithBody(T, B)

Has associated streaming body

Implementations§

Source§

impl<T, B> Message<T, B>

Source

pub fn get_ref(&self) -> &T

Returns a reference to the inner value

Source

pub fn get_mut(&mut self) -> &mut T

Returns a mutable reference to the inner value

Source

pub fn into_inner(self) -> T

Consumes the value and returns the inner value

Source

pub fn take_body(&mut self) -> Option<B>

If the Message value has an associated body stream, return it. The original Message value will then become a WithoutBody variant.

Trait Implementations§

Source§

impl<T, B> Debug for Message<T, B>
where T: Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T, B> Deref for Message<T, B>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T, B> DerefMut for Message<T, B>

Source§

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

Mutably dereferences the value.
Source§

impl<T, B> PartialEq<T> for Message<T, B>
where T: PartialEq,

Source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T, B> Freeze for Message<T, B>
where T: Freeze, B: Freeze,

§

impl<T, B> RefUnwindSafe for Message<T, B>

§

impl<T, B> Send for Message<T, B>
where T: Send, B: Send,

§

impl<T, B> Sync for Message<T, B>
where T: Sync, B: Sync,

§

impl<T, B> Unpin for Message<T, B>
where T: Unpin, B: Unpin,

§

impl<T, B> UnwindSafe for Message<T, B>
where T: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.