pub struct Db { /* private fields */ }Implementations§
Source§impl Db
impl Db
pub fn new(path: &str) -> Self
Sourcepub fn get_database_path() -> Result<PathBuf, Box<dyn Error>>
pub fn get_database_path() -> Result<PathBuf, Box<dyn Error>>
Get the platform-appropriate database path
Sourcepub fn new_with_default_path() -> Result<Self, Box<dyn Error>>
pub fn new_with_default_path() -> Result<Self, Box<dyn Error>>
Create a new Db instance using the platform-appropriate path
pub fn add_timer_to_db(&self, timer: &mut Timer) -> Result<(), Error>
pub fn get_timers_from_db(&self) -> Result<Vec<Timer>, Error>
pub fn update_timers_in_db(&self, timers: &Vec<Timer>) -> Result<(), Error>
pub fn delete_timer(&self, id: usize) -> Result<(), Error>
pub fn edit_timer( &self, timer: &Timer, name: &str, description: &str, ) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Db
impl RefUnwindSafe for Db
impl Send for Db
impl Sync for Db
impl Unpin for Db
impl UnsafeUnpin for Db
impl UnwindSafe for Db
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