pub struct EncodedMessage {
pub msg_type: MessageType,
pub payload: Bytes,
}Expand description
Wire-ready application message: a type discriminator plus its serialised payload.
Fields§
§msg_type: MessageTypeApplication-defined message type discriminator.
payload: BytesSerialised payload bytes.
Implementations§
Source§impl EncodedMessage
impl EncodedMessage
Sourcepub fn new(msg_type: MessageType, payload: Bytes) -> Self
pub fn new(msg_type: MessageType, payload: Bytes) -> Self
Constructs an EncodedMessage from a type tag and a payload.
Trait Implementations§
Source§impl Clone for EncodedMessage
impl Clone for EncodedMessage
Source§fn clone(&self) -> EncodedMessage
fn clone(&self) -> EncodedMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodedMessage
impl Debug for EncodedMessage
Source§impl PartialEq for EncodedMessage
impl PartialEq for EncodedMessage
Source§fn eq(&self, other: &EncodedMessage) -> bool
fn eq(&self, other: &EncodedMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for EncodedMessage
impl StructuralPartialEq for EncodedMessage
Auto Trait Implementations§
impl !Freeze for EncodedMessage
impl RefUnwindSafe for EncodedMessage
impl Send for EncodedMessage
impl Sync for EncodedMessage
impl Unpin for EncodedMessage
impl UnsafeUnpin for EncodedMessage
impl UnwindSafe for EncodedMessage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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