pub struct NetSignal {
pub bw_bps: u64,
pub workers: u16,
pub backlog_bytes: u64,
pub overlap_rho: f64,
pub max_encode_us: u64,
pub max_queue_us: u64,
pub max_window_log: u32,
pub mem_budget_bytes: u64,
pub cpu_weight: f64,
pub bw_weight: f64,
}adaptive only.Expand description
Real-time link, concurrency, latency, and memory signals for compression decisions.
Fields§
§bw_bps: u64Effective link capacity in bytes/s (0 = unknown, selects default preset).
workers: u16Encoder worker concurrency (>= 1).
backlog_bytes: u64Queued uncompressed bytes waiting ahead of the encoder pool.
overlap_rho: f64Pipeline overlap factor in [0.0, 1.0] (0.0 = serial/low-latency, 0.85..=1.0 = pipeline).
max_encode_us: u64Hard per-block encoding latency ceiling in microseconds (0 = unbounded).
max_queue_us: u64Hard queue drain ceiling in microseconds (0 = unbounded).
max_window_log: u32Maximum per-context Zstd windowLog (10..=27).
mem_budget_bytes: u64Per-context memory ceiling in bytes (0 = unbounded).
cpu_weight: f64Tie-breaker penalty weight against burning CPU for diminishing ratio gains.
bw_weight: f64Extra bandwidth-saving weight (> 0 favors smaller wire size on metered links).
Implementations§
Source§impl NetSignal
impl NetSignal
Sourcepub const fn serial(bw_bps: u64) -> Self
pub const fn serial(bw_bps: u64) -> Self
Builds a serial single-frame signal (latency-dominated: overlap_rho = 0.0).
Sourcepub const fn pipeline(bw_bps: u64, workers: u16, backlog_bytes: u64) -> Self
pub const fn pipeline(bw_bps: u64, workers: u16, backlog_bytes: u64) -> Self
Builds a multi-worker pipelined bulk signal (overlap_rho = 0.85).
Sourcepub const fn low_latency(bw_bps: u64, rtt_us: u64) -> Self
pub const fn low_latency(bw_bps: u64, rtt_us: u64) -> Self
Builds a low-latency interactive terminal/RPC signal (32 KiB window, tight budget).