pub struct TrackerDb { /* private fields */ }Expand description
SQLite-backed token savings tracker.
Implementations§
Source§impl TrackerDb
impl TrackerDb
Sourcepub fn open() -> Result<Self, TrackerError>
pub fn open() -> Result<Self, TrackerError>
Open or create the tracker database in the user’s data directory.
§Errors
Returns TrackerError if the data directory is unavailable or SQLite fails.
Sourcepub fn record(&self, event: &FilterEvent) -> Result<(), TrackerError>
pub fn record(&self, event: &FilterEvent) -> Result<(), TrackerError>
Sourcepub fn gain_summary(&self, days: u32) -> Result<GainSummary, TrackerError>
pub fn gain_summary(&self, days: u32) -> Result<GainSummary, TrackerError>
Sourcepub fn daily_report(&self, days: u32) -> Result<Vec<DailyStats>, TrackerError>
pub fn daily_report(&self, days: u32) -> Result<Vec<DailyStats>, TrackerError>
Sourcepub fn recent_events(
&self,
limit: u32,
) -> Result<Vec<FilterEvent>, TrackerError>
pub fn recent_events( &self, limit: u32, ) -> Result<Vec<FilterEvent>, TrackerError>
Auto Trait Implementations§
impl !Freeze for TrackerDb
impl !RefUnwindSafe for TrackerDb
impl Send for TrackerDb
impl !Sync for TrackerDb
impl Unpin for TrackerDb
impl UnsafeUnpin for TrackerDb
impl !UnwindSafe for TrackerDb
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