Trait cfxcore::message::Message

source ·
pub trait Message: Send + Sync + GetMaybeRequestId + MessageProtocolVersionBound {
    // Required methods
    fn msg_id(&self) -> MsgId;
    fn msg_name(&self) -> &'static str;
    fn encode(&self) -> Vec<u8> ;

    // Provided methods
    fn is_size_sensitive(&self) -> bool { ... }
    fn push_msg_id_leb128_encoding(&self, buffer: &mut Vec<u8>) { ... }
    fn priority(&self) -> SendQueuePriority { ... }
    fn throttle_token_cost(&self) -> (u64, u64) { ... }
    fn send(
        &self,
        io: &dyn NetworkContext,
        node_id: &NodeId
    ) -> Result<(), NetworkError> { ... }
    fn send_with_throttling(
        &self,
        io: &dyn NetworkContext,
        node_id: &NodeId,
        throttling_disabled: bool
    ) -> Result<(), NetworkError> { ... }
}

Required Methods§

source

fn msg_id(&self) -> MsgId

source

fn msg_name(&self) -> &'static str

source

fn encode(&self) -> Vec<u8>

Provided Methods§

source

fn is_size_sensitive(&self) -> bool

source

fn push_msg_id_leb128_encoding(&self, buffer: &mut Vec<u8>)

source

fn priority(&self) -> SendQueuePriority

source

fn throttle_token_cost(&self) -> (u64, u64)

source

fn send( &self, io: &dyn NetworkContext, node_id: &NodeId ) -> Result<(), NetworkError>

source

fn send_with_throttling( &self, io: &dyn NetworkContext, node_id: &NodeId, throttling_disabled: bool ) -> Result<(), NetworkError>

Implementations on Foreign Types§

source§

impl Message for EpochRetrievalRequest

source§

fn msg_id(&self) -> MsgId

source§

fn msg_name(&self) -> &'static str

source§

fn encode(&self) -> Vec<u8>

source§

impl Message for ProposalMsg

source§

fn msg_id(&self) -> MsgId

source§

fn msg_name(&self) -> &'static str

source§

fn encode(&self) -> Vec<u8>

source§

impl Message for SyncInfo

source§

fn msg_id(&self) -> MsgId

source§

fn msg_name(&self) -> &'static str

source§

fn encode(&self) -> Vec<u8>

source§

impl Message for VoteMsg

source§

fn msg_id(&self) -> MsgId

source§

fn msg_name(&self) -> &'static str

source§

fn encode(&self) -> Vec<u8>

source§

impl Message for EpochChangeProof

source§

fn msg_id(&self) -> MsgId

source§

fn msg_name(&self) -> &'static str

source§

fn encode(&self) -> Vec<u8>

Implementors§

source§

impl Message for MempoolSyncMsg

source§

impl Message for BlockRetrievalRpcRequest

source§

impl Message for BlockRetrievalRpcResponse

source§

impl Message for DynamicCapabilityChange

source§

impl Message for GetBlockHashesByEpoch

source§

impl Message for GetBlockHashesResponse

source§

impl Message for GetBlockHeaders

source§

impl Message for GetBlockHeadersResponse

source§

impl Message for GetBlockTxn

source§

impl Message for GetBlockTxnResponse

source§

impl Message for GetBlocks

source§

impl Message for GetBlocksResponse

source§

impl Message for GetBlocksWithPublicResponse

source§

impl Message for GetCompactBlocks

source§

impl Message for GetCompactBlocksResponse

source§

impl Message for GetTerminalBlockHashes

source§

impl Message for GetTerminalBlockHashesResponse

source§

impl Message for GetTransactions

source§

impl Message for GetTransactionsFromTxHashes

source§

impl Message for GetTransactionsFromTxHashesResponse

source§

impl Message for GetTransactionsResponse

source§

impl Message for Heartbeat

source§

impl Message for NewBlock

source§

impl Message for NewBlockHashes

source§

impl Message for SnapshotChunkRequest

source§

impl Message for SnapshotChunkResponse

source§

impl Message for SnapshotManifestRequest

source§

impl Message for SnapshotManifestResponse

source§

impl Message for StateSyncCandidateRequest

source§

impl Message for StateSyncCandidateResponse

source§

impl Message for StatusV2

source§

impl Message for StatusV3

source§

impl Message for Throttled

source§

impl Message for TransactionDigests

source§

impl Message for Transactions