pub struct SettingsStore { /* private fields */ }Expand description
键值设置。同名 key 后写覆盖前写;空值等于删除。
Implementations§
Source§impl SettingsStore
impl SettingsStore
pub fn get(&self, key: &str) -> Option<&str>
pub fn set(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn remove(&mut self, key: &str)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_dirty(&self) -> bool
pub fn load(&mut self, path: &Path) -> Result<()>
pub fn save(&mut self, path: &Path) -> Result<()>
Trait Implementations§
Source§impl Clone for SettingsStore
impl Clone for SettingsStore
Source§impl Debug for SettingsStore
impl Debug for SettingsStore
Auto Trait Implementations§
impl Forget for SettingsStore
impl Freeze for SettingsStore
impl Move for SettingsStore
impl RefUnwindSafe for SettingsStore
impl Send for SettingsStore
impl Sync for SettingsStore
impl Unpin for SettingsStore
impl UnsafeUnpin for SettingsStore
impl UnwindSafe for SettingsStore
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