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>>,
}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
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceSettings
impl Debug for DeviceSettings
Source§impl Default for DeviceSettings
impl Default for DeviceSettings
Source§impl<'de> Deserialize<'de> for DeviceSettings
impl<'de> Deserialize<'de> for DeviceSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeviceSettings
impl RefUnwindSafe for DeviceSettings
impl Send for DeviceSettings
impl Sync for DeviceSettings
impl Unpin for DeviceSettings
impl UnwindSafe for DeviceSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more