pub enum Command {
Show 15 variants GetBlockByHeight(HeightSender<Option<BlockHeader>>), GetPeers(ServiceFlags, Sender<Vec<Peer>>), GetTip(Sender<(Height, BlockHeader)>), GetBlock(BlockHash), GetFilters(RangeInclusive<Height>, Sender<Result<(), GetFiltersError>>), Rescan { from: Bound<Height>, to: Bound<Height>, watch: Vec<Script>, }, Watch { watch: Vec<Script>, }, Broadcast(NetworkMessage, fn(_: Peer) -> boolSender<Vec<PeerId>>), Query(NetworkMessage, Sender<Option<SocketAddr>>), QueryTree(Arc<dyn Fn(&dyn BlockReader) + Send + Sync>), Connect(SocketAddr), Disconnect(SocketAddr), ImportHeaders(Vec<BlockHeader>, Sender<Result<ImportResult, Error>>), ImportAddresses(Vec<Address>), SubmitTransaction(Transaction, Sender<Result<NonEmpty<PeerId>, CommandError>>),
}
Expand description

A command or request that can be sent to the protocol.

Variants

GetBlockByHeight(HeightSender<Option<BlockHeader>>)

Get block header at height.

GetPeers(ServiceFlags, Sender<Vec<Peer>>)

Get connected peers.

GetTip(Sender<(Height, BlockHeader)>)

Get the tip of the active chain.

GetBlock(BlockHash)

Get a block from the active chain.

GetFilters(RangeInclusive<Height>, Sender<Result<(), GetFiltersError>>)

Get block filters.

Rescan

Fields

from: Bound<Height>

Start scan from this height. If unbounded, start at the current height.

to: Bound<Height>

Stop scanning at this height. If unbounded, don’t stop scanning.

watch: Vec<Script>

Scripts to match on.

Rescan the chain for matching scripts and addresses.

Watch

Fields

watch: Vec<Script>

Scripts to watch.

Update the watchlist with the provided scripts.

Broadcast(NetworkMessage, fn(_: Peer) -> boolSender<Vec<PeerId>>)

Broadcast to peers matching the predicate.

Query(NetworkMessage, Sender<Option<SocketAddr>>)

Send a message to a random peer.

QueryTree(Arc<dyn Fn(&dyn BlockReader) + Send + Sync>)

Query the block tree.

Connect(SocketAddr)

Connect to a peer.

Disconnect(SocketAddr)

Disconnect from a peer.

ImportHeaders(Vec<BlockHeader>, Sender<Result<ImportResult, Error>>)

Import headers directly into the block store.

ImportAddresses(Vec<Address>)

Import addresses into the address book.

SubmitTransaction(Transaction, Sender<Result<NonEmpty<PeerId>, CommandError>>)

Submit a transaction to the network.

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

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
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.