pub struct ThingsDatabase { /* private fields */ }Expand description
Main database access struct
Implementations§
Source§impl ThingsDatabase
impl ThingsDatabase
Sourcepub fn new<P: AsRef<Path>>(db_path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(db_path: P) -> Result<Self>
Create a new database connection
§Errors
Returns ThingsError::Database if the database cannot be opened
Sourcepub fn with_config(config: &ThingsConfig) -> Result<Self>
pub fn with_config(config: &ThingsConfig) -> Result<Self>
Create a new database connection using configuration
§Errors
Returns ThingsError::Database if the database cannot be opened
Returns ThingsError::Message if the database path is not found and fallback fails
Sourcepub fn default_path() -> String
pub fn default_path() -> String
Get the default Things 3 database path
Sourcepub fn with_default_path() -> Result<Self>
pub fn with_default_path() -> Result<Self>
Create with default database path
§Errors
Returns ThingsError::Database if the database cannot be opened
Auto Trait Implementations§
impl !Freeze for ThingsDatabase
impl !RefUnwindSafe for ThingsDatabase
impl Send for ThingsDatabase
impl !Sync for ThingsDatabase
impl Unpin for ThingsDatabase
impl !UnwindSafe for ThingsDatabase
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