pub struct RawConfig(/* private fields */);
Expand description
Offers utility functions for editing the configuration. Validates on write.
Implementations§
Source§impl RawConfig
impl RawConfig
Sourcepub fn from_file(path: &Path) -> Result<RawConfig, WriteError>
pub fn from_file(path: &Path) -> Result<RawConfig, WriteError>
Creates a temporary configuration, by reading a configuration file from disk.
Sourcepub fn get_mut(&mut self, config_path: &ConfigPath) -> Option<&mut Value>
pub fn get_mut(&mut self, config_path: &ConfigPath) -> Option<&mut Value>
Get a mutable reference to a configuration value by path, if it exists.
Sourcepub fn unset(&mut self, config_path: &ConfigPath) -> Result<Value, ModifyError>
pub fn unset(&mut self, config_path: &ConfigPath) -> Result<Value, ModifyError>
Delete the specified path.
pub fn push( &mut self, config_path: &ConfigPath, value: ConfigValue, ) -> Result<Value, ModifyError>
pub fn remove( &mut self, config_path: &ConfigPath, value: ConfigValue, ) -> Result<Value, ModifyError>
pub fn set( &mut self, config_path: &ConfigPath, value: ConfigValue, ) -> Result<Value, ModifyError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawConfig
impl RefUnwindSafe for RawConfig
impl Send for RawConfig
impl Sync for RawConfig
impl Unpin for RawConfig
impl UnwindSafe for RawConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more