pub struct RawNetworkMessage { /* private fields */ }
Available on crate feature
std
only.Expand description
A Network message
Implementations§
Source§impl RawNetworkMessage
impl RawNetworkMessage
Sourcepub fn new(magic: Magic, payload: NetworkMessage) -> Self
pub fn new(magic: Magic, payload: NetworkMessage) -> Self
Creates a RawNetworkMessage
Sourcepub fn payload(&self) -> &NetworkMessage
pub fn payload(&self) -> &NetworkMessage
The actual message data
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§
Source§impl Clone for RawNetworkMessage
impl Clone for RawNetworkMessage
Source§fn clone(&self) -> RawNetworkMessage
fn clone(&self) -> RawNetworkMessage
Returns a copy of the value. Read more
1.0.0 · 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 RawNetworkMessage
impl Debug for RawNetworkMessage
Source§impl Decodable for RawNetworkMessage
impl Decodable for RawNetworkMessage
Source§impl Encodable for RawNetworkMessage
impl Encodable for RawNetworkMessage
Source§impl PartialEq for RawNetworkMessage
impl PartialEq for RawNetworkMessage
impl Eq for RawNetworkMessage
impl StructuralPartialEq for RawNetworkMessage
Auto Trait Implementations§
impl Freeze for RawNetworkMessage
impl RefUnwindSafe for RawNetworkMessage
impl Send for RawNetworkMessage
impl Sync for RawNetworkMessage
impl Unpin for RawNetworkMessage
impl UnwindSafe for RawNetworkMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)