Struct settingsfile::ShadowSettings
source · Implementations
sourceimpl<T> ShadowSettings<T>where
T: Format + Clone,
impl<T> ShadowSettings<T>where
T: Format + Clone,
pub fn new(config: T) -> ShadowSettings<T>
sourcepub fn create_from(file: &File, config: T) -> Result<ShadowSettings<T>, Error>
pub fn create_from(file: &File, config: T) -> Result<ShadowSettings<T>, Error>
assumse global
pub fn load_global_from(&mut self, file: &mut File) -> Result<(), Error>
pub fn load_local_from(&mut self, file: &mut File) -> Result<(), Error>
sourcepub fn save(&self) -> Result<(), Error>
pub fn save(&self) -> Result<(), Error>
saves the setting to a file, uses the save_to
buffer function
pub fn save_global_to(&self, file: &File) -> Result<(), Error>
pub fn save_local_to(&self, file: &File) -> Result<(), Error>
pub fn get_value_absolute(&self, key_path: &str) -> Option<Type>
pub fn get_value(&self, key_path: &str) -> Option<Type>
pub fn get_value_local(&self, key_path: &str) -> Option<Type>
pub fn get_value_global(&self, key_path: &str) -> Option<Type>
pub fn set_value_local<A: ?Sized>(
&mut self,
key_path: &str,
value: &A
) -> Result<(), Error>where
A: SupportedType,
pub fn set_value_global<A: ?Sized>(
&mut self,
key_path: &str,
value: &A
) -> Result<(), Error>where
A: SupportedType,
pub fn delete_key_local(&mut self, key_path: &str) -> Option<Type>
pub fn delete_key_global(&mut self, key_path: &str) -> Option<Type>
Trait Implementations
sourceimpl<T: Clone> Clone for ShadowSettings<T>where
T: Format + Clone,
impl<T: Clone> Clone for ShadowSettings<T>where
T: Format + Clone,
sourcefn clone(&self) -> ShadowSettings<T>
fn clone(&self) -> ShadowSettings<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'de, T> Deserialize<'de> for ShadowSettings<T>where
T: Format + Clone,
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ShadowSettings<T>where
T: Format + Clone,
T: Deserialize<'de>,
sourcefn 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<T> RefUnwindSafe for ShadowSettings<T>where
T: RefUnwindSafe,
impl<T> Send for ShadowSettings<T>where
T: Send,
impl<T> Sync for ShadowSettings<T>where
T: Sync,
impl<T> Unpin for ShadowSettings<T>where
T: Unpin,
impl<T> UnwindSafe for ShadowSettings<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more