pub enum Command {
Show 15 variants
GetBlockByHeight(u64, Sender<Option<BlockHeader>>),
GetPeers(ServiceFlags, Sender<Vec<Peer>>),
GetTip(Sender<(u64, BlockHeader)>),
GetBlock(BlockHash),
GetFilters(RangeInclusive<u64>, Sender<Result<(), GetFiltersError>>),
Rescan {
from: Bound<u64>,
to: Bound<u64>,
watch: Vec<Script>,
},
Watch {
watch: Vec<Script>,
},
Broadcast(NetworkMessage, fn(Peer) -> bool, Sender<Vec<SocketAddr>>),
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<SocketAddr>, CommandError>>),
}Expand description
A command or request that can be sent to the protocol.
Variants§
GetBlockByHeight(u64, Sender<Option<BlockHeader>>)
Get block header at height.
GetPeers(ServiceFlags, Sender<Vec<Peer>>)
Get connected peers.
GetTip(Sender<(u64, BlockHeader)>)
Get the tip of the active chain.
GetBlock(BlockHash)
Get a block from the active chain.
GetFilters(RangeInclusive<u64>, Sender<Result<(), GetFiltersError>>)
Get block filters.
Rescan
Rescan the chain for matching scripts and addresses.
Fields
Watch
Update the watchlist with the provided scripts.
Broadcast(NetworkMessage, fn(Peer) -> bool, Sender<Vec<SocketAddr>>)
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<SocketAddr>, CommandError>>)
Submit a transaction to the network.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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