network-protocol 1.2.1

Secure, high-performance protocol core with backpressure control, structured logging, timeout handling, TLS support, and comprehensive benchmarking for robust Rust networked applications and services.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::protocol::message::Message;

/// Builds a heartbeat ping message
pub fn build_ping() -> Message {
    Message::Ping
}

/// Returns true if a received message is a valid pong
pub fn is_pong(msg: &Message) -> bool {
    matches!(msg, Message::Pong)
}