Enum RecvMsg

Source
pub enum RecvMsg {
    Request(Request),
    Notify(Notify),
}

Variants§

§

Request(Request)

§

Notify(Notify)

Implementations§

Source§

impl RecvMsg

Source

pub fn is_request(&self) -> bool

Returns true if this is a RecvMsg::Request, otherwise false

Source

pub fn as_request_mut(&mut self) -> Option<&mut Request>

Optionally returns mutable references to the inner fields if this is a RecvMsg::Request, otherwise None

Source

pub fn as_request(&self) -> Option<&Request>

Optionally returns references to the inner fields if this is a RecvMsg::Request, otherwise None

Source

pub fn into_request(self) -> Result<Request, Self>

Returns the inner fields if this is a RecvMsg::Request, otherwise returns back the enum in the Err case of the result

Source

pub fn is_notify(&self) -> bool

Returns true if this is a RecvMsg::Notify, otherwise false

Source

pub fn as_notify_mut(&mut self) -> Option<&mut Notify>

Optionally returns mutable references to the inner fields if this is a RecvMsg::Notify, otherwise None

Source

pub fn as_notify(&self) -> Option<&Notify>

Optionally returns references to the inner fields if this is a RecvMsg::Notify, otherwise None

Source

pub fn into_notify(self) -> Result<Notify, Self>

Returns the inner fields if this is a RecvMsg::Notify, otherwise returns back the enum in the Err case of the result

Trait Implementations§

Source§

impl Debug for RecvMsg

Source§

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

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

impl ExtractUserData for RecvMsg

Source§

impl Message for RecvMsg

Source§

fn payload(&self) -> &[u8]

Source§

fn raw(&self) -> &[u8]

Source§

fn raw_bytes(&self) -> Bytes

Source§

fn codec(&self) -> &dyn Codec

Source§

fn parse<'a, T: Deserialize<'a>>(&'a self) -> Result<T, DecodeError>

Parses payload as speicfied type.
Source§

impl MessageMethodName for RecvMsg

Source§

fn method_raw(&self) -> &[u8]

Source§

fn method(&self) -> Option<&str>

Auto Trait Implementations§

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.
Source§

impl<T> UserData for T
where T: Any + Send + Sync + 'static,

Source§

fn as_any(&self) -> &(dyn Any + Send + Sync + 'static)