pub struct Message {
pub v: u8,
pub t: String,
pub id: u32,
pub flags: u8,
pub p: Vec<u8>,
/* private fields */
}Expand description
Decoded message with its original frame retained for unknown fields/forwarding.
Fields§
§v: u8Actual envelope generation.
t: StringActual wire name, including unknown future names.
id: u32Frame correlation ID.
flags: u8Actual frame flags.
p: Vec<u8>Original encoded payload.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(frame: RawFrame, envelope: Envelope) -> Message
pub fn new(frame: RawFrame, envelope: Envelope) -> Message
Construct a view for a custom envelope codec without losing original bytes.
Sourcepub fn payload<T>(&self) -> Result<T, ClientError>where
T: DeserializeOwned,
pub fn payload<T>(&self) -> Result<T, ClientError>where
T: DeserializeOwned,
Decode a known payload without narrowing the incoming message namespace.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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