pub struct RawNetworkMessage { /* private fields */ }Expand description
A Network message
Implementations§
Source§impl RawNetworkMessage
impl RawNetworkMessage
Sourcepub fn new(magic: Magic, payload: NetworkMessage) -> RawNetworkMessage
pub fn new(magic: Magic, payload: NetworkMessage) -> RawNetworkMessage
Creates a RawNetworkMessage
Sourcepub fn into_payload(self) -> NetworkMessage
pub fn into_payload(self) -> NetworkMessage
Consumes the RawNetworkMessage instance and returns the inner payload.
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 duplicate 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§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 moreSource§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
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.