pub struct Message {
pub message_type: MessageType,
pub data_items: Vec<DataItem>,
}Expand description
A DLEP TCP session message.
Wire format (RFC 8175 §11.2):
message_type: u16 || length: u16 || <data items>
Unlike signals, messages do NOT carry the ASCII "DLEP" prefix.
Fields§
§message_type: MessageType§data_items: Vec<DataItem>Implementations§
Source§impl Message
impl Message
Sourcepub fn encode(&self) -> Result<BytesMut, CodecError>
pub fn encode(&self) -> Result<BytesMut, CodecError>
Encode this message into a fresh BytesMut. Returns an error if any
contained DataItem cannot be expressed on the wire (see
DataItem::encode for which values can fail).
pub fn decode(src: Bytes) -> Result<Self, CodecError>
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