Struct async_sqlite::Client
source · pub struct Client { /* private fields */ }
Expand description
Client represents a single sqlite connection that can be used from async contexts.
Implementations§
source§impl Client
impl Client
sourcepub async fn conn<F, T>(&self, func: F) -> Result<T, Error>
pub async fn conn<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a rusqlite::Connection
.
sourcepub async fn conn_mut<F, T>(&self, func: F) -> Result<T, Error>
pub async fn conn_mut<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a mutable rusqlite::Connection
.
sourcepub async fn close(&self) -> Result<(), Error>
pub async fn close(&self) -> Result<(), Error>
Closes the underlying sqlite connection.
After this method returns, all calls to self::conn()
or
self::conn_mut()
will return an Error::Closed
error.
sourcepub fn conn_blocking<F, T>(&self, func: F) -> Result<T, Error>
pub fn conn_blocking<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a rusqlite::Connection
, blocking
the current thread until completion.
sourcepub fn conn_mut_blocking<F, T>(&self, func: F) -> Result<T, Error>
pub fn conn_mut_blocking<F, T>(&self, func: F) -> Result<T, Error>
Invokes the provided function with a mutable rusqlite::Connection
,
blocking the current thread until completion.
sourcepub fn close_blocking(&self) -> Result<(), Error>
pub fn close_blocking(&self) -> Result<(), Error>
Closes the underlying sqlite connection, blocking the current thread until complete.
After this method returns, all calls to self::conn_blocking()
or
self::conn_mut_blocking()
will return an Error::Closed
error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)