refactor(common): add prelude module

This commit is contained in:
2026-02-25 18:51:25 +02:00
parent 8f0d2a6efc
commit 0ea39e7663
11 changed files with 17 additions and 30 deletions

View File

@@ -1,8 +1,3 @@
//! Self-signed certificate generation for local testing.
//!
//! Generates a CA certificate and server certificate for TLS benchmarking.
//! These certificates are NOT suitable for production use.
use rcgen::{BasicConstraints, CertificateParams, DnType, IsCa, Issuer, KeyPair, SanType};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};

View File

@@ -2,6 +2,7 @@
pub mod cert;
pub mod error;
pub mod prelude;
pub mod protocol;
pub use error::Error;

4
common/src/prelude.rs Normal file
View File

@@ -0,0 +1,4 @@
pub use crate::{
BenchRecord, KeyExchangeMode,
protocol::{read_payload, read_request, write_payload, write_request},
};

View File

@@ -1,11 +1,3 @@
//! Benchmark protocol implementation.
//!
//! Protocol specification:
//! 1. Client sends 8-byte little-endian u64: requested payload size N
//! 2. Server responds with exactly N bytes (deterministic pattern)
//!
//! The deterministic pattern is a repeating sequence of bytes 0x00..0xFF.
// Casts are intentional: MAX_PAYLOAD_SIZE (16 MiB) fits in usize on 64-bit,
// and byte patterns are explicitly masked to 0xFF before casting.
#![allow(clippy::cast_possible_truncation)]