pub struct AsyncDatabase { /* private fields */ }Expand description
An async facade over a Database.
open/open_in_memory and connect dispatch to tokio::task::spawn_blocking.
Implementations§
Source§impl AsyncDatabase
impl AsyncDatabase
Sourcepub fn from_database(db: Database) -> AsyncDatabase
pub fn from_database(db: Database) -> AsyncDatabase
Wraps an existing Database for async use.
Sourcepub async fn open<P>(path: P) -> Result<AsyncDatabase>
pub async fn open<P>(path: P) -> Result<AsyncDatabase>
Sourcepub async fn open_in_memory() -> Result<AsyncDatabase>
pub async fn open_in_memory() -> Result<AsyncDatabase>
Sourcepub async fn connect(&self) -> Result<AsyncConnection>
pub async fn connect(&self) -> Result<AsyncConnection>
Opens a new connection to this database.
§Errors
Returns an error if the connection cannot be established.
Trait Implementations§
Source§impl Clone for AsyncDatabase
impl Clone for AsyncDatabase
Source§fn clone(&self) -> AsyncDatabase
fn clone(&self) -> AsyncDatabase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AsyncDatabase
impl RefUnwindSafe for AsyncDatabase
impl Send for AsyncDatabase
impl Sync for AsyncDatabase
impl Unpin for AsyncDatabase
impl UnsafeUnpin for AsyncDatabase
impl UnwindSafe for AsyncDatabase
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