Struct async_rusqlite::Database
source · 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>where
P: Into<PathBuf>,
S: FnMut(&mut Connection) -> Result<(), BoxedError> + Send + 'static,
pub async fn open<P, S>( path: P, create_if_missing: bool, setup_func: S ) -> Result<Self, Error>where P: Into<PathBuf>, S: FnMut(&mut Connection) -> Result<(), BoxedError> + Send + 'static,
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>where
P: AsRef<Path>,
S: FnMut(&mut Connection) -> Result<(), BoxedError> + Send + 'static,
pub fn blocking_open<P, S>( path: P, create_if_missing: bool, setup_func: S ) -> Result<Self, Error>where P: AsRef<Path>, S: FnMut(&mut Connection) -> Result<(), BoxedError> + Send + 'static,
Open a db in a blocking manner.
sourcepub async fn access_db<F, T>(&self, func: F) -> Result<T, Error>where
F: FnOnce(&mut Connection) -> T + Send + 'static,
T: Send + 'static,
pub async fn access_db<F, T>(&self, func: F) -> Result<T, Error>where F: FnOnce(&mut Connection) -> T + Send + 'static, T: Send + 'static,
Access the database.
Trait Implementations§
Auto Trait Implementations§
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