pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
pub fn new() -> Result<Self>
pub fn load(&self) -> Result<Vec<Reminder>>
pub fn save(&self, reminders: &[Reminder]) -> Result<()>
pub fn add(&self, reminder: Reminder) -> Result<()>
pub fn delete(&self, id: Uuid) -> Result<bool>
pub fn update( &self, id: Uuid, updater: impl FnOnce(&mut Reminder) -> Result<()>, ) -> Result<bool>
pub fn get(&self, id: Uuid) -> Result<Option<Reminder>>
Sourcepub fn find_by_short_id(&self, short_id: &str) -> Result<Option<Reminder>>
pub fn find_by_short_id(&self, short_id: &str) -> Result<Option<Reminder>>
Find reminder by short ID (prefix match)
Sourcepub fn delete_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
pub fn delete_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
Delete reminder by short ID
Sourcepub fn clean_completed(&self) -> Result<usize>
pub fn clean_completed(&self) -> Result<usize>
Clean completed reminders
pub fn pid_file_path() -> Result<PathBuf>
pub fn log_file_path() -> Result<PathBuf>
pub fn heartbeat_file_path() -> Result<PathBuf>
Get all unique tags
Sourcepub fn pause_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
pub fn pause_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
Pause reminder by short ID
Sourcepub fn resume_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
pub fn resume_by_short_id(&self, short_id: &str) -> Result<Option<Uuid>>
Resume reminder by short ID
Sourcepub fn export_to_file(&self, path: &Path) -> Result<usize>
pub fn export_to_file(&self, path: &Path) -> Result<usize>
Export all reminders to a JSON file
Auto Trait Implementations§
impl Freeze for Storage
impl RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnwindSafe for Storage
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