Enum rpc_it::rpc::msg::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 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 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.