pub struct ReflectorConfigBuilder<Cs, Ms, Bn> { /* private fields */ }Expand description
Typestate builder for ReflectorConfig.
Parameters:
Cs—MissingorProvided, tracks whether the callsign has been set.Ms— tracks whether the module set has been provided.Bn— tracks whether the bind address has been set.
Self::build is only implemented when all three markers are
Provided — forgetting any required field turns .build() into
a compile error.
Implementations§
Source§impl<Cs, Ms, Bn> ReflectorConfigBuilder<Cs, Ms, Bn>
impl<Cs, Ms, Bn> ReflectorConfigBuilder<Cs, Ms, Bn>
Sourcepub fn callsign(
self,
callsign: Callsign,
) -> ReflectorConfigBuilder<Provided, Ms, Bn>
pub fn callsign( self, callsign: Callsign, ) -> ReflectorConfigBuilder<Provided, Ms, Bn>
Set the reflector callsign.
Sourcepub fn module_set(
self,
modules: HashSet<Module>,
) -> ReflectorConfigBuilder<Cs, Provided, Bn>
pub fn module_set( self, modules: HashSet<Module>, ) -> ReflectorConfigBuilder<Cs, Provided, Bn>
Set the module set (HashSet<Module> — pass one or more module letters).
Sourcepub fn bind(self, bind: SocketAddr) -> ReflectorConfigBuilder<Cs, Ms, Provided>
pub fn bind(self, bind: SocketAddr) -> ReflectorConfigBuilder<Cs, Ms, Provided>
Set the UDP bind address.
Sourcepub const fn max_clients_per_module(self, value: usize) -> Self
pub const fn max_clients_per_module(self, value: usize) -> Self
Override the maximum clients per module (default 50).
Sourcepub const fn max_total_clients(self, value: usize) -> Self
pub const fn max_total_clients(self, value: usize) -> Self
Override the maximum total clients (default 250).
Sourcepub const fn keepalive_interval(self, value: Duration) -> Self
pub const fn keepalive_interval(self, value: Duration) -> Self
Override the keepalive poll interval (default 1s).
Sourcepub const fn keepalive_inactivity_timeout(self, value: Duration) -> Self
pub const fn keepalive_inactivity_timeout(self, value: Duration) -> Self
Override the keepalive inactivity timeout (default 30s).
Sourcepub const fn voice_inactivity_timeout(self, value: Duration) -> Self
pub const fn voice_inactivity_timeout(self, value: Duration) -> Self
Override the voice inactivity timeout (default 2s).
Sourcepub const fn cross_protocol_forwarding(self, value: bool) -> Self
pub const fn cross_protocol_forwarding(self, value: bool) -> Self
Enable or disable cross-protocol forwarding (default false).
Sourcepub const fn tx_rate_limit_frames_per_sec(self, value: f64) -> Self
pub const fn tx_rate_limit_frames_per_sec(self, value: f64) -> Self
Override the per-client TX rate limit in frames per second
(default 60.0).
The default is 3× the nominal 20 fps D-STAR voice rate, so
legitimate voice streams never hit the limit. Lower it to
tighten the DoS envelope; raise it if you expect large bursts
of legitimate traffic.
Source§impl ReflectorConfigBuilder<Provided, Provided, Provided>
impl ReflectorConfigBuilder<Provided, Provided, Provided>
Sourcepub fn build(self) -> Result<ReflectorConfig, ConfigError>
pub fn build(self) -> Result<ReflectorConfig, ConfigError>
Finalize the configuration.
§Errors
Returns ConfigError::EmptyModules if the supplied module
set was empty. All other required fields are guaranteed
non-None by the typestate markers.