Struct bdk_chain::bitcoin::p2p::message::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 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
§fn eq(&self, other: &RawNetworkMessage) -> bool
fn eq(&self, other: &RawNetworkMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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
§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