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> { ... }
}