pub struct SqliteConnectionManager { /* private fields */ }Expand description
A wrapper around a SQLite connection that can be used with bb8
Since rusqlite::Connection is not Send, we wrap it in a Mutex and use spawn_blocking for all operations.
Implementations§
Trait Implementations§
Source§impl ManageConnection for SqliteConnectionManager
impl ManageConnection for SqliteConnectionManager
Source§type Connection = PooledConnection
type Connection = PooledConnection
The connection type this manager deals with.
Source§type Error = SqliteError
type Error = SqliteError
The error type returned by
Connections.Source§fn connect(
&self,
) -> impl Future<Output = Result<Self::Connection, Self::Error>> + Send
fn connect( &self, ) -> impl Future<Output = Result<Self::Connection, Self::Error>> + Send
Attempts to create a new connection.
Source§fn is_valid<'a, 'b>(
&'a self,
conn: &'b mut Self::Connection,
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn is_valid<'a, 'b>( &'a self, conn: &'b mut Self::Connection, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Determines if the connection is still connected to the database.
Source§fn has_broken(&self, _conn: &mut Self::Connection) -> bool
fn has_broken(&self, _conn: &mut Self::Connection) -> bool
Synchronously determine if the connection is no longer usable, if possible.
Auto Trait Implementations§
impl Freeze for SqliteConnectionManager
impl RefUnwindSafe for SqliteConnectionManager
impl Send for SqliteConnectionManager
impl Sync for SqliteConnectionManager
impl Unpin for SqliteConnectionManager
impl UnsafeUnpin for SqliteConnectionManager
impl UnwindSafe for SqliteConnectionManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.