[][src]Enum networking::Message

pub enum Message {
    Addr {
        addrs: Vec<EncapsulatedAddr>,
    },
    BlockTxn {
        block_hash: [u8; 32],
        txs: Vec<Transaction>,
    },
    Block {
        block_header: BlockHeader,
        transactions: Vec<Transaction>,
    },
    CompactBlock {
        header: BlockHeader,
        nonce: u64,
        short_ids: Vec<u64>,
        prefilled_txns: Vec<PrefilledTransaction>,
    },
    FeeFilter {
        feerate: u64,
    },
    FilterAdd {
        elements: Vec<Vec<u8>>,
    },
    FilterClear {},
    FilterLoad {
        filter: Vec<u8>,
        n_hash_funcs: u32,
        n_tweak: u32,
        n_flags: u8,
    },
    GetAddr {},
    GetBlockTxn {
        block_hash: [u8; 32],
        indexes: Vec<CompactInt>,
    },
    GetBlocks {
        protocol_version: u32,
        block_header_hashes: Vec<u256>,
        stop_hash: u256,
    },
    GetData {
        inventory: Vec<InventoryData>,
    },
    GetHeaders {
        protocol_version: u32,
        block_header_hashes: Vec<u256>,
        stop_hash: u256,
    },
    Headers {
        headers: Vec<BlockHeader>,
    },
    Inv {
        inventory: Vec<InventoryData>,
    },
    MemPool {},
    MerkleBlock {
        block_header: BlockHeader,
        transaction_count: u32,
        hashes: Vec<u256>,
        flags: Vec<u8>,
    },
    NotFound {
        inventory_data: Vec<InventoryData>,
    },
    Ping {
        nonce: u64,
    },
    Pong {
        nonce: u64,
    },
    Reject {
        message: String,
        code: u8,
        reason: String,
        extra_data: Option<[u8; 32]>,
    },
    SendCompact {
        announce: bool,
        version: u64,
    },
    SendHeaders {},
    Tx {
        transaction: Transaction,
    },
    Verack {},
    Version {
        protocol_version: u32,
        services: u64,
        timestamp: u64,
        receiver_services: u64,
        receiver: SocketAddr,
        transmitter_services: u64,
        transmitter_ip: SocketAddr,
        nonce: u64,
        user_agent: String,
        best_block: u32,
        relay: bool,
    },
}

An enumeration of all Bitcoin Wire Protocol messages, (i.e. GetHeaders, Version, Verack).

Messages are actual messages, as opposed to Commands which are a shorthand way of referring to a type of Message. A Message takes about 90 bytes of data on the stack, while a Command is a single byte.

Variants

Addr

Fields of Addr

addrs: Vec<EncapsulatedAddr>
BlockTxn

Fields of BlockTxn

block_hash: [u8; 32]txs: Vec<Transaction>
Block

Fields of Block

block_header: BlockHeadertransactions: Vec<Transaction>
CompactBlock

Fields of CompactBlock

header: BlockHeadernonce: u64short_ids: Vec<u64>prefilled_txns: Vec<PrefilledTransaction>
FeeFilter

Fields of FeeFilter

feerate: u64
FilterAdd

Fields of FilterAdd

elements: Vec<Vec<u8>>
FilterClear

Fields of FilterClear

FilterLoad

Fields of FilterLoad

filter: Vec<u8>n_hash_funcs: u32n_tweak: u32n_flags: u8
GetAddr

Fields of GetAddr

GetBlockTxn

Fields of GetBlockTxn

block_hash: [u8; 32]indexes: Vec<CompactInt>
GetBlocks

Fields of GetBlocks

protocol_version: u32block_header_hashes: Vec<u256>stop_hash: u256
GetData

Fields of GetData

inventory: Vec<InventoryData>
GetHeaders

Fields of GetHeaders

protocol_version: u32block_header_hashes: Vec<u256>stop_hash: u256
Headers

Fields of Headers

headers: Vec<BlockHeader>
Inv

Fields of Inv

inventory: Vec<InventoryData>
MemPool

Fields of MemPool

MerkleBlock

Fields of MerkleBlock

block_header: BlockHeadertransaction_count: u32hashes: Vec<u256>flags: Vec<u8>
NotFound

Fields of NotFound

inventory_data: Vec<InventoryData>
Ping

Fields of Ping

nonce: u64
Pong

Fields of Pong

nonce: u64
Reject

Fields of Reject

message: Stringcode: u8reason: Stringextra_data: Option<[u8; 32]>
SendCompact

Fields of SendCompact

announce: boolversion: u64
SendHeaders

Fields of SendHeaders

Tx

Fields of Tx

transaction: Transaction
Verack

Fields of Verack

Version

Fields of Version

protocol_version: u32services: u64timestamp: u64receiver_services: u64receiver: SocketAddrtransmitter_services: u64transmitter_ip: SocketAddrnonce: u64user_agent: Stringbest_block: u32relay: bool

Implementations

impl Message[src]

pub fn version(
    peer_ip: SocketAddr,
    peer_services: u64,
    warpd_ip: SocketAddr,
    best_block: u32,
    config: &Config
) -> Message
[src]

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

Trait Implementations

impl Debug for Message[src]

impl Encoder<Message> for Codec[src]

type Error = Error

The type of encoding errors. Read more

impl Serializable for Message[src]

Auto Trait Implementations

impl RefUnwindSafe for Message

impl Send for Message

impl Sync for Message

impl Unpin for Message

impl UnwindSafe for Message

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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.