pub enum Command {
Show 18 variants
Connect,
AcknowledgeConnection,
Ping {
height: usize,
},
Pong {
height: usize,
},
GetPeers,
SendPeers {
peers: Vec<String>,
},
NewBlock {
block: Block,
},
NewBlockResolved,
NewTransaction {
transaction: Transaction,
},
NewTransactionResolved,
GetBlockMetadata {
block_hash: Hash,
},
GetBlockMetadataResponse {
block_metadata: Option<BlockMetadata>,
},
GetBlock {
block_hash: Hash,
},
GetBlockResponse {
block: Option<Block>,
},
GetBlockHashes {
start: usize,
end: usize,
},
GetBlockHashesResponse {
block_hashes: Vec<Hash>,
},
GetTransactionMerkleProof {
block: Hash,
transaction_id: TransactionId,
},
GetTransactionMerkleProofResponse {
proof: Option<MerkleTreeProof>,
},
}Expand description
Struct that contains every command (request, response) sent on the p2p network
Variants§
Connect
AcknowledgeConnection
Ping
Pong
GetPeers
SendPeers
NewBlock
NewBlockResolved
NewTransaction
Fields
§
transaction: TransactionNewTransactionResolved
GetBlockMetadata
GetBlockMetadataResponse
Fields
§
block_metadata: Option<BlockMetadata>GetBlock
GetBlockResponse
GetBlockHashes
GetBlockHashesResponse
GetTransactionMerkleProof
GetTransactionMerkleProofResponse
Fields
§
proof: Option<MerkleTreeProof>Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Command
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Command
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
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