pub struct DeviceSettings {
pub server_hostname: String,
pub api_endpoint: String,
pub initialized: bool,
pub default_data_path: String,
pub profiles: HashMap<String, HashMap<String, String>>,
pub role_config: Option<String>,
pub default_role: Option<String>,
}Expand description
Configuration settings for the device (i.e. the server or runtime).
These values are set when the server is initialized, and do not change while running. These are constructed from default or local files and ENV variables.
Fields§
§server_hostname: StringThe address to listen on
api_endpoint: StringAPI endpoint for the server
initialized: boolinit completed
default_data_path: Stringdefault data path
profiles: HashMap<String, HashMap<String, String>>configured storage backends available on device
role_config: Option<String>Path to a JSON role configuration file (supports ~, $HOME, ${VAR:-default})
On first run, roles are loaded from this file and saved to persistence.
Subsequent runs use persistence (so CLI changes stick). Use config reload to re-read.
default_role: Option<String>Default role name to select on startup (must exist in the role_config file)
Implementations§
Source§impl DeviceSettings
impl DeviceSettings
Sourcepub fn default_embedded() -> Self
pub fn default_embedded() -> Self
Create default embedded DeviceSettings without filesystem operations Used for embedded/offline mode where config files are not needed
Sourcepub fn default_config_path() -> PathBuf
pub fn default_config_path() -> PathBuf
Get the default path for the config file
This is the default path where the config file is stored.
Sourcepub fn load_from_env_and_file(
config_path: Option<PathBuf>,
) -> DeviceSettingsResult<Self>
pub fn load_from_env_and_file( config_path: Option<PathBuf>, ) -> DeviceSettingsResult<Self>
Load settings from environment and file config path shall be a folder and not file
pub fn update_initialized_flag( &mut self, settings_path: Option<PathBuf>, initialized: bool, ) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for DeviceSettings
impl Clone for DeviceSettings
Source§fn clone(&self) -> DeviceSettings
fn clone(&self) -> DeviceSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more