Function encoded_client_len

Source
pub fn encoded_client_len(packet: &ClientPacket) -> Result<usize, EncodeError>
Expand description

Exact v5 wire length after validating every client field; allocates nothing. Includes the six-byte header and session/envelope overhead. See encode_client_into for the shared validation/precedence contract.

use ferravex_net::{ClientPacket, encoded_client_len};
assert_eq!(encoded_client_len(&ClientPacket::Hello { nonce: 7 }), Ok(14));