pub enum Command {
Connect,
AcknowledgeConnection,
Ping {
height: usize,
},
Pong {
height: usize,
},
GetPeers,
SendPeers {
peers: Vec<String>,
},
NewBlock {
block: Block,
},
NewTransaction {
transaction: Transaction,
},
GetBlock {
block_hash: Hash,
},
GetBlockResponse {
block: Option<Block>,
},
GetBlockHashes {
start: usize,
end: usize,
},
GetBlockHashesResponse {
block_hashes: Vec<Hash>,
},
}Expand description
Struct that contains every command (request, response) sent on the p2p network
Variants§
Connect
AcknowledgeConnection
Ping
Pong
GetPeers
SendPeers
NewBlock
NewTransaction
Fields
§
transaction: TransactionGetBlock
GetBlockResponse
GetBlockHashes
GetBlockHashesResponse
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)