pub struct Settings {
pub env: HashMap<String, String>,
}Expand description
Settings loaded from $HOME/.omni-dev/settings.json.
Fields§
§env: HashMap<String, String>Environment variable overrides.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Loads settings from a specific path.
Sourcepub fn get_settings_path() -> Result<PathBuf>
pub fn get_settings_path() -> Result<PathBuf>
Returns the default settings path.
Sourcepub fn get_env_var(&self, key: &str) -> Option<String>
pub fn get_env_var(&self, key: &str) -> Option<String>
Returns an environment variable with fallback to settings.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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 Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
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