Struct RawNetworkMessage
pub struct RawNetworkMessage { /* private fields */ }
Expand description
A Network message
Implementations§
§impl RawNetworkMessage
impl RawNetworkMessage
pub fn new(magic: Magic, payload: NetworkMessage) -> RawNetworkMessage
pub fn new(magic: Magic, payload: NetworkMessage) -> RawNetworkMessage
Creates a RawNetworkMessage
pub fn into_payload(self) -> NetworkMessage
pub fn into_payload(self) -> NetworkMessage
Consumes the RawNetworkMessage instance and returns the inner payload.
pub fn payload(&self) -> &NetworkMessage
pub fn payload(&self) -> &NetworkMessage
The actual message data
pub 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.
pub fn command(&self) -> CommandString
pub fn command(&self) -> CommandString
Return the CommandString for the message command.
Trait Implementations§
§impl Clone for RawNetworkMessage
impl Clone for RawNetworkMessage
§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 more§impl Debug for RawNetworkMessage
impl Debug for RawNetworkMessage
§impl Decodable for RawNetworkMessage
impl Decodable for RawNetworkMessage
§fn consensus_decode_from_finite_reader<R>(
r: &mut R,
) -> Result<RawNetworkMessage, Error>
fn consensus_decode_from_finite_reader<R>( r: &mut R, ) -> Result<RawNetworkMessage, Error>
Decode
Self
from a size-limited reader. Read more§fn consensus_decode<R>(r: &mut R) -> Result<RawNetworkMessage, Error>
fn consensus_decode<R>(r: &mut R) -> Result<RawNetworkMessage, Error>
Decode an object with a well-defined format. Read more
§impl Encodable for RawNetworkMessage
impl Encodable for RawNetworkMessage
§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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more