pub struct RawNetworkMessage {
pub magic: u32,
pub payload: NetworkMessage,
}
Available on crate feature
std
only.Expand description
A Network message
Fields
magic: u32
Magic bytes to identify the network these messages are meant for
payload: NetworkMessage
The actual message data
Implementations
sourceimpl RawNetworkMessage
impl RawNetworkMessage
sourcepub fn cmd(&self) -> &'static str
pub fn cmd(&self) -> &'static str
Return the message command as a static string reference.
This returns "unknown"
for NetworkMessage::Unknown,
regardless of the actual command in the unknown message.
Use the Self::command method to get the command for unknown messages.
sourcepub fn command(&self) -> CommandString
pub fn command(&self) -> CommandString
Return the CommandString for the message command.
Trait Implementations
sourceimpl Clone for RawNetworkMessage
impl Clone for RawNetworkMessage
sourcefn clone(&self) -> RawNetworkMessage
fn clone(&self) -> RawNetworkMessage
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for RawNetworkMessage
impl Debug for RawNetworkMessage
sourceimpl Decodable for RawNetworkMessage
impl Decodable for RawNetworkMessage
sourceimpl Encodable for RawNetworkMessage
impl Encodable for RawNetworkMessage
sourceimpl PartialEq<RawNetworkMessage> for RawNetworkMessage
impl PartialEq<RawNetworkMessage> for RawNetworkMessage
sourcefn eq(&self, other: &RawNetworkMessage) -> bool
fn eq(&self, other: &RawNetworkMessage) -> bool
impl Eq for RawNetworkMessage
impl StructuralEq for RawNetworkMessage
impl StructuralPartialEq for RawNetworkMessage
Auto Trait Implementations
impl RefUnwindSafe for RawNetworkMessage
impl Send for RawNetworkMessage
impl Sync for RawNetworkMessage
impl Unpin for RawNetworkMessage
impl UnwindSafe for RawNetworkMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more