pub struct FilePreferences { /* private fields */ }Expand description
File-backed preferences with coordinated, atomic writes within this process.
Instances opening the same canonical path share their values and writer.
Reads include pending changes after a failed write; PreferencesStore::flush
retries them. A successful write synchronizes the file before replacing it.
Concurrent access from other processes is not supported.
Implementations§
Trait Implementations§
Source§impl Default for FilePreferences
impl Default for FilePreferences
Source§impl PreferencesStore for FilePreferences
impl PreferencesStore for FilePreferences
Source§fn set_many(
&self,
values: &BTreeMap<String, String>,
) -> Result<(), PreferencesError>
fn set_many( &self, values: &BTreeMap<String, String>, ) -> Result<(), PreferencesError>
Writes a group of values. File-backed stores replace the file once.
A failure may leave pending values visible; retry this batch or call
flush.Source§fn flush(&self) -> Result<(), PreferencesError>
fn flush(&self) -> Result<(), PreferencesError>
Retries pending writes. Success means the backend accepted all pending data.
Auto Trait Implementations§
impl !Freeze for FilePreferences
impl RefUnwindSafe for FilePreferences
impl Send for FilePreferences
impl Sync for FilePreferences
impl Unpin for FilePreferences
impl UnsafeUnpin for FilePreferences
impl UnwindSafe for FilePreferences
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