use std::net::SocketAddr;
use std::time::Duration;
#[derive(Debug, Clone)]
pub struct RawShredConfig {
pub udp_bind: SocketAddr,
pub udp_recv_buffer_bytes: usize,
pub max_datagram_size: usize,
pub max_tracked_slots: usize,
pub reassembly_gap_timeout: Duration,
pub forward_slot_watermark: bool,
pub udp_payload_prefix_skip: usize,
pub max_deshred_bytes: usize,
}
impl Default for RawShredConfig {
fn default() -> Self {
Self {
udp_bind: "0.0.0.0:8001".parse().expect("valid default UDP bind"),
udp_recv_buffer_bytes: 64 * 1024 * 1024,
max_datagram_size: 2048,
max_tracked_slots: 64,
reassembly_gap_timeout: Duration::from_millis(400),
forward_slot_watermark: false,
udp_payload_prefix_skip: 0,
max_deshred_bytes: 16 * 1024 * 1024,
}
}
}
impl RawShredConfig {
pub fn with_udp_bind(mut self, udp_bind: SocketAddr) -> Self {
self.udp_bind = udp_bind;
self
}
pub fn with_forward_slot_watermark(mut self, enabled: bool) -> Self {
self.forward_slot_watermark = enabled;
self
}
}