pub enum UserRequest {
Config,
Block(BlockHash),
UtreexoProof(BlockHash),
MempoolTransaction(Txid),
GetPeerInfo,
GetConnectionCount,
Add((IpAddr, u16, bool)),
Remove((IpAddr, u16)),
Onetry((IpAddr, u16, bool)),
Disconnect((IpAddr, u16)),
Ping,
SendTransaction(Transaction),
}Expand description
A request that can be made to the node.
While the node is running, consumers may want to request some useful data, like block data, mempool transactions or tell the node to connect with some given peers. This struct represents all the possible requests that can be made to the node as well as the data that needs to be sent along with the request.
Variants§
Config
Request the UtreexoNodeConfig of the node.
Block(BlockHash)
Get a block by its hash.
This will cause network requests to be made to fetch the block data.
UtreexoProof(BlockHash)
Get the Utreexo proof and LeafData for a block by its hash.
MempoolTransaction(Txid)
Get an unconfirmed transaction from the mempool by its ID.
GetPeerInfo
Return information about all connected peers.
GetConnectionCount
Return the number of connected peers.
Add((IpAddr, u16, bool))
Add a peer to the node’s peer list.
This function will add this peer to a special list of peers such that, if we lose the connection, we will keep trying to connect to it until we succeed.
Remove((IpAddr, u16))
Removes a node from the node’s peer list.
This function will remove a node that was added with AddNode::Add. This will not
disconnect the peer, but if it disconnects, it will not be reconnected again.
Onetry((IpAddr, u16, bool))
Attempts to connect to a peer once.
Different from AddNode::Add, this function will try to connect to the peer once, but
will not add it to the node’s added peers list.
Disconnect((IpAddr, u16))
Attempt to disconnect from a peer.
Ping
Ping all connected peers to check if they are alive.
SendTransaction(Transaction)
Adds a transaction to mempool and advertises it
Trait Implementations§
Source§impl Clone for UserRequest
impl Clone for UserRequest
Source§fn clone(&self) -> UserRequest
fn clone(&self) -> UserRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UserRequest
impl Debug for UserRequest
Source§impl Hash for UserRequest
impl Hash for UserRequest
Source§impl PartialEq for UserRequest
impl PartialEq for UserRequest
impl Eq for UserRequest
impl StructuralPartialEq for UserRequest
Auto Trait Implementations§
impl Freeze for UserRequest
impl RefUnwindSafe for UserRequest
impl Send for UserRequest
impl Sync for UserRequest
impl Unpin for UserRequest
impl UnwindSafe for UserRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.