pub struct RawConfig(/* private fields */);๐Deprecated
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 UnsafeUnpin 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