pub struct Message { /* private fields */ }Expand description
A single Message that is send between the Server and Client
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(header: MessageHeader, data: Vec<u8>) -> Self
pub fn new(header: MessageHeader, data: Vec<u8>) -> Self
Creates a new Message with the given “raw” Data
Sourcepub fn serialize(&self, header: &mut [u8; 13]) -> &[u8] ⓘ
pub fn serialize(&self, header: &mut [u8; 13]) -> &[u8] ⓘ
Serializes the Message into a Vector of Bytes that can then be send over to the other side (Server or Client)
Sourcepub fn get_header(&self) -> &MessageHeader
pub fn get_header(&self) -> &MessageHeader
The Header of this message
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