pub struct UnitManagerConfig {
pub max_units: usize,
pub default_word_order: WordOrder,
pub broadcast_mode: BroadcastMode,
pub auto_create_units: bool,
pub default_register_config: RegisterStoreConfig,
pub enable_unit_metrics: bool,
}Expand description
Configuration for the MultiUnitManager.
Fields§
§max_units: usizeMaximum number of units that can be managed.
Default: 247 (Modbus max addressable units: 1-247)
default_word_order: WordOrderDefault word order for new units.
Individual units can override this.
broadcast_mode: BroadcastModeBroadcast handling mode for Unit ID 0.
auto_create_units: boolWhether to allow creating units on-demand.
If true, accessing a non-existent unit will create it with default config. If false, accessing a non-existent unit returns None.
default_register_config: RegisterStoreConfigDefault register store configuration for new units.
enable_unit_metrics: boolEnable metrics collection per unit.
Implementations§
Source§impl UnitManagerConfig
impl UnitManagerConfig
Sourcepub fn with_max_units(self, max_units: usize) -> Self
pub fn with_max_units(self, max_units: usize) -> Self
Create a new config with specified max units.
Sourcepub fn with_word_order(self, word_order: WordOrder) -> Self
pub fn with_word_order(self, word_order: WordOrder) -> Self
Set the default word order.
Sourcepub fn with_broadcast_mode(self, mode: BroadcastMode) -> Self
pub fn with_broadcast_mode(self, mode: BroadcastMode) -> Self
Set the broadcast mode.
Sourcepub fn with_auto_create(self, auto_create: bool) -> Self
pub fn with_auto_create(self, auto_create: bool) -> Self
Enable auto-creation of units.
Sourcepub fn with_register_config(self, config: RegisterStoreConfig) -> Self
pub fn with_register_config(self, config: RegisterStoreConfig) -> Self
Set the default register configuration.
Sourcepub fn for_testing() -> Self
pub fn for_testing() -> Self
Create a config for testing with minimal resources.
Sourcepub fn for_large_scale() -> Self
pub fn for_large_scale() -> Self
Create a config for large-scale simulation.
Trait Implementations§
Source§impl Clone for UnitManagerConfig
impl Clone for UnitManagerConfig
Source§fn clone(&self) -> UnitManagerConfig
fn clone(&self) -> UnitManagerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more