pub enum Message {
Show 25 variants
Addr(Addr),
Block(Block),
FeeFilter(FeeFilter),
FilterAdd(FilterAdd),
FilterClear,
FilterLoad(FilterLoad),
GetAddr,
GetBlocks(BlockLocator),
GetData(Inv),
GetHeaders(BlockLocator),
Headers(Headers),
Inv(Inv),
Mempool,
MerkleBlock(MerkleBlock),
NotFound(Inv),
Other(String),
Partial(MessageHeader),
Ping(Ping),
Pong(Ping),
Reject(Reject),
SendHeaders,
SendCmpct(SendCmpct),
Tx(Tx),
Verack,
Version(Version),
}
Expand description
Bitcoin peer-to-peer message with its payload
Variants§
Addr(Addr)
Block(Block)
FeeFilter(FeeFilter)
FilterAdd(FilterAdd)
FilterClear
FilterLoad(FilterLoad)
GetAddr
GetBlocks(BlockLocator)
GetData(Inv)
GetHeaders(BlockLocator)
Headers(Headers)
Inv(Inv)
Mempool
MerkleBlock(MerkleBlock)
NotFound(Inv)
Other(String)
Partial(MessageHeader)
Ping(Ping)
Pong(Ping)
Reject(Reject)
SendHeaders
SendCmpct(SendCmpct)
Tx(Tx)
Verack
Version(Version)
Implementations§
Source§impl Message
impl Message
Sourcepub fn read(reader: &mut dyn Read, magic: [u8; 4]) -> Result<Self>
pub fn read(reader: &mut dyn Read, magic: [u8; 4]) -> Result<Self>
Reads a Bitcoin P2P message with its payload from bytes
It’s possible for a message’s header to be read but not its payload. In this case, the return value is not an Error but a Partial message, and the complete message may be read later using read_partial.
Sourcepub fn read_partial(
reader: &mut dyn Read,
header: &MessageHeader,
) -> Result<Self>
pub fn read_partial( reader: &mut dyn Read, header: &MessageHeader, ) -> Result<Self>
Reads the complete message given a message header
It may be used after read() returns Message::Partial.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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