pub struct Persistence { /* private fields */ }Implementations§
Source§impl Persistence
impl Persistence
Sourcepub fn new() -> AppResult<Self>
pub fn new() -> AppResult<Self>
Creates a new persistence instance for storing key-value data.
This initializes the persistence layer, creating the config directory if needed, and loads existing state from disk if available.
§Returns
Returns an AppResult<Self> containing the new Persistence instance.
§Errors
Returns an error if the config directory cannot be created or accessed.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears all stored key-value pairs.
Marks the state as dirty. Call flush() to save to disk.
Trait Implementations§
Source§impl Clone for Persistence
impl Clone for Persistence
Source§impl Debug for Persistence
impl Debug for Persistence
Source§impl Default for Persistence
impl Default for Persistence
Source§fn default() -> Persistence
fn default() -> Persistence
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Persistence
impl RefUnwindSafe for Persistence
impl Send for Persistence
impl Sync for Persistence
impl Unpin for Persistence
impl UnsafeUnpin for Persistence
impl UnwindSafe for Persistence
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