pub enum Event {
Show 13 variants Ready { tip: Height, filter_tip: Height, }, PeerConnected { addr: PeerId, link: Link, }, PeerDisconnected { addr: PeerId, reason: Disconnect<DisconnectReason>, }, PeerConnectionFailed { addr: PeerId, error: Arc<Error>, }, PeerNegotiated { addr: PeerId, link: Link, services: ServiceFlags, height: Height, user_agent: String, version: u32, }, PeerHeightUpdated { height: Height, }, BlockConnected { header: BlockHeader, hash: BlockHash, height: Height, }, BlockDisconnected { header: BlockHeader, hash: BlockHash, height: Height, }, BlockMatched { hash: BlockHash, header: BlockHeader, height: Height, transactions: Vec<Transaction>, }, FeeEstimated { block: BlockHash, height: Height, fees: FeeEstimate, }, FilterProcessed { block: BlockHash, height: Height, matched: bool, valid: bool, }, TxStatusChanged { txid: Txid, status: TxStatus, }, Synced { height: Height, tip: Height, },
}
Expand description

Event emitted by the client, after the “loading” phase is over.

Variants

Ready

Fields

tip: Height

The tip of the block header chain.

filter_tip: Height

The tip of the filter header chain.

Ready to process peer events and start receiving commands. Note that this isn’t necessarily the first event emitted.

PeerConnected

Fields

addr: PeerId

Peer address.

link: Link

Connection link.

Peer connected. This is fired when the physical TCP/IP connection is established. Use Event::PeerNegotiated to know when the P2P handshake has completed.

PeerDisconnected

Fields

addr: PeerId

Peer address.

reason: Disconnect<DisconnectReason>

Reason for disconnection.

Peer disconnected after successful connection.

PeerConnectionFailed

Fields

addr: PeerId

Peer address.

error: Arc<Error>

Connection error.

Connection was never established and timed out or failed.

PeerNegotiated

Fields

addr: PeerId

Peer address.

link: Link

Connection link.

services: ServiceFlags

Peer services.

height: Height

Peer height.

user_agent: String

Peer user agent.

version: u32

Negotiated protocol version.

Peer handshake completed. The peer connection is fully functional from this point.

PeerHeightUpdated

Fields

height: Height

Best block height known.

The best known height amongst connected peers has been updated. Note that there is no guarantee that this height really exists; peers don’t have to follow the protocol and could send a bogus height.

BlockConnected

Fields

header: BlockHeader

Block header.

hash: BlockHash

Block hash.

height: Height

Height of the block.

A block was added to the main chain.

BlockDisconnected

Fields

header: BlockHeader

Header of the block.

hash: BlockHash

Block hash.

height: Height

Height of the block when it was part of the main chain.

One of the blocks of the main chain was reverted, due to a re-org. These events will fire from the latest block starting from the tip, to the earliest. Mark all transactions belonging to this block as unconfirmed.

BlockMatched

Fields

hash: BlockHash

Hash of the matching block.

header: BlockHeader

Block header.

height: Height

Block height.

transactions: Vec<Transaction>

Transactions in this block.

A block has matched one of the filters and is ready to be processed. This event usually precedes Event::TxStatusChanged events.

FeeEstimated

Fields

block: BlockHash

Block hash of the estimate.

height: Height

Block height of the estimate.

fees: FeeEstimate

Fee estimate.

Transaction fee rate estimated for a block.

FilterProcessed

Fields

block: BlockHash

Corresponding block hash.

height: Height

Filter height (same as block).

matched: bool

Whether or not this filter matched any of the watched scripts.

valid: bool

Whether or not this filter is valid.

A filter was processed. If it matched any of the scripts in the watchlist, the corresponding block was scheduled for download, and a Event::BlockMatched event will eventually be fired.

TxStatusChanged

Fields

txid: Txid

The Transaction ID.

status: TxStatus

The new transaction status.

The status of a transaction has changed.

Synced

Fields

height: Height

Height up to which we are synced.

tip: Height

Tip of our block header chain.

Compact filters have been synced and processed up to this point and matching blocks have been fetched.

If filters have been processed up to the last block in the client’s header chain, height and tip will be equal.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.