[][src]Enum bitcoin::network::message::NetworkMessage

pub enum NetworkMessage {
    Version(VersionMessage),
    Verack,
    Addr(Vec<(u32, Address)>),
    Inv(Vec<Inventory>),
    GetData(Vec<Inventory>),
    NotFound(Vec<Inventory>),
    GetBlocks(GetBlocksMessage),
    GetHeaders(GetHeadersMessage),
    MemPool,
    Tx(Transaction),
    Block(Block),
    Headers(Vec<BlockHeader>),
    SendHeaders,
    GetAddr,
    Ping(u64),
    Pong(u64),
    GetCFilters(GetCFilters),
    CFilter(CFilter),
    GetCFHeaders(GetCFHeaders),
    CFHeaders(CFHeaders),
    GetCFCheckpt(GetCFCheckpt),
    CFCheckpt(CFCheckpt),
    Alert(Vec<u8>),
    Reject(Reject),
    FeeFilter(i64),
    WtxidRelay,
    AddrV2(Vec<AddrV2Message>),
    SendAddrV2,
    Unknown {
        command: CommandString,
        payload: Vec<u8>,
    },
}

A Network message payload. Proper documentation is available on at Bitcoin Wiki: Protocol Specification

Variants

Version(VersionMessage)

version

Verack

verack

Addr(Vec<(u32, Address)>)

addr

Inv(Vec<Inventory>)

inv

GetData(Vec<Inventory>)

getdata

NotFound(Vec<Inventory>)

notfound

GetBlocks(GetBlocksMessage)

getblocks

GetHeaders(GetHeadersMessage)

getheaders

MemPool

mempool

Tx(Transaction)

tx

Block(Block)

block

Headers(Vec<BlockHeader>)

headers

SendHeaders

sendheaders

GetAddr

getaddr

Ping(u64)

ping

Pong(u64)

pong

GetCFilters(GetCFilters)

BIP157 getcfilters

CFilter(CFilter)

BIP157 cfilter

GetCFHeaders(GetCFHeaders)

BIP157 getcfheaders

CFHeaders(CFHeaders)

BIP157 cfheaders

GetCFCheckpt(GetCFCheckpt)

BIP157 getcfcheckpt

CFCheckpt(CFCheckpt)

BIP157 cfcheckpt

Alert(Vec<u8>)

alert

Reject(Reject)

reject

FeeFilter(i64)

feefilter

WtxidRelay

wtxidrelay

AddrV2(Vec<AddrV2Message>)

addrv2

SendAddrV2

sendaddrv2

Unknown

Any other message.

Fields of Unknown

command: CommandString

The command of this message.

payload: Vec<u8>

The payload of this message.

Methods

impl NetworkMessage[src]

pub fn cmd(&self) -> &'static str[src]

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 [command] method to get the command for unknown messages.

pub fn command(&self) -> CommandString[src]

Return the CommandString for the message command.

Trait Implementations

impl Clone for NetworkMessage[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<NetworkMessage> for NetworkMessage[src]

impl Eq for NetworkMessage[src]

impl Debug for NetworkMessage[src]

Auto Trait Implementations

impl Unpin for NetworkMessage

impl Sync for NetworkMessage

impl Send for NetworkMessage

impl UnwindSafe for NetworkMessage

impl RefUnwindSafe for NetworkMessage

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]