pub struct Database { /* private fields */ }Expand description
A database connection
Implementations§
Source§impl Database
impl Database
Sourcepub async fn open<P, S>(
path: P,
create_if_missing: bool,
setup_func: S,
) -> Result<Self, Error>
pub async fn open<P, S>( path: P, create_if_missing: bool, setup_func: S, ) -> Result<Self, Error>
Open a database at the given path with the setup func.
Sourcepub fn blocking_open<P, S>(
path: P,
create_if_missing: bool,
setup_func: S,
) -> Result<Self, Error>
pub fn blocking_open<P, S>( path: P, create_if_missing: bool, setup_func: S, ) -> Result<Self, Error>
Open a db in a blocking manner.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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