pub struct StorageManager { /* private fields */ }Expand description
High-level storage manager that provides transactional operations and automatic external modification tracking.
Implementations§
Source§impl StorageManager
impl StorageManager
Sourcepub fn load_with_tracking(&mut self, date: Date) -> Result<DayData>
pub fn load_with_tracking(&mut self, date: Date) -> Result<DayData>
Load day data with automatic revision tracking
Sourcepub fn check_and_reload(&mut self, date: Date) -> Result<Option<DayData>>
pub fn check_and_reload(&mut self, date: Date) -> Result<Option<DayData>>
Check if day data changed externally and reload if needed. Returns Some(DayData) if data was modified and reloaded, None if no change.
Sourcepub fn add_record(&mut self, date: Date, record: WorkRecord) -> Result<()>
pub fn add_record(&mut self, date: Date, record: WorkRecord) -> Result<()>
Add a new work record (transactional: load -> add -> save -> track)
Sourcepub fn update_record(&mut self, date: Date, record: WorkRecord) -> Result<()>
pub fn update_record(&mut self, date: Date, record: WorkRecord) -> Result<()>
Update an existing work record (transactional: load -> update -> save -> track)
Sourcepub fn remove_record(&mut self, date: Date, id: u32) -> Result<WorkRecord>
pub fn remove_record(&mut self, date: Date, id: u32) -> Result<WorkRecord>
Remove a work record by ID (transactional: load -> remove -> save -> track) Returns the removed record if found.
Sourcepub fn get_last_modified(&self, date: &Date) -> Option<SystemTime>
pub fn get_last_modified(&self, date: &Date) -> Option<SystemTime>
Get the last known modification token for a date
pub fn save_active_timer(&self, timer: &TimerState) -> Result<()>
pub fn load_active_timer(&self) -> Result<Option<TimerState>>
pub fn clear_active_timer(&self) -> Result<()>
pub fn start_timer( &self, task_name: String, description: Option<String>, project: Option<String>, customer: Option<String>, source_record_id: Option<u32>, source_record_date: Option<Date>, ) -> Result<TimerState>
pub fn stop_timer(&self) -> Result<WorkRecord>
pub fn pause_timer(&self) -> Result<TimerState>
pub fn resume_timer(&self) -> Result<TimerState>
pub fn get_timer_elapsed(&self, timer: &TimerState) -> Duration
Auto Trait Implementations§
impl Freeze for StorageManager
impl RefUnwindSafe for StorageManager
impl Send for StorageManager
impl Sync for StorageManager
impl Unpin for StorageManager
impl UnsafeUnpin for StorageManager
impl UnwindSafe for StorageManager
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> 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