pub struct AsyncDieselConnectionManager<C> { /* private fields */ }
Available on crate feature
pool
only.Expand description
Implementations§
Source§impl<C> AsyncDieselConnectionManager<C>where
C: AsyncConnection + 'static,
impl<C> AsyncDieselConnectionManager<C>where
C: AsyncConnection + 'static,
Sourcepub fn new(connection_url: impl Into<String>) -> Selfwhere
C: AsyncConnection + 'static,
pub fn new(connection_url: impl Into<String>) -> Selfwhere
C: AsyncConnection + 'static,
Returns a new connection manager, which establishes connections to the given database URL.
Sourcepub fn new_with_config(
connection_url: impl Into<String>,
manager_config: ManagerConfig<C>,
) -> Self
pub fn new_with_config( connection_url: impl Into<String>, manager_config: ManagerConfig<C>, ) -> Self
Returns a new connection manager, which establishes connections with the given database URL and that uses the specified configuration
Trait Implementations§
Source§impl<C> Debug for AsyncDieselConnectionManager<C>
impl<C> Debug for AsyncDieselConnectionManager<C>
Source§impl<C> ManageConnection for AsyncDieselConnectionManager<C>where
C: PoolableConnection + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature bb8
only.
impl<C> ManageConnection for AsyncDieselConnectionManager<C>where
C: PoolableConnection + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature
bb8
only.Source§type Connection = C
type Connection = C
The connection type this manager deals with.
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempts to create a new connection.
Source§fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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.
Source§impl<C> Manager for AsyncDieselConnectionManager<C>where
C: PoolableConnection + Send + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature deadpool
only.
impl<C> Manager for AsyncDieselConnectionManager<C>where
C: PoolableConnection + Send + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature
deadpool
only.Source§impl<C> Manager for AsyncDieselConnectionManager<C>where
C: PoolableConnection + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature mobc
only.
impl<C> Manager for AsyncDieselConnectionManager<C>where
C: PoolableConnection + 'static,
select<AsExprOf<i32, Integer>>: ExecuteDsl<C>,
SqlQuery: QueryFragment<C::Backend>,
Available on crate feature
mobc
only.Source§type Connection = C
type Connection = C
The connection type this manager deals with.
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempts to create a new connection.
Source§fn check<'life0, 'async_trait>(
&'life0 self,
conn: Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check<'life0, 'async_trait>(
&'life0 self,
conn: Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Determines if the connection is still connected to the database when check-out. Read more
Source§fn spawn_task<T>(&self, task: T)
fn spawn_task<T>(&self, task: T)
Spawns a new asynchronous task.
Source§fn validate(&self, _conn: &mut Self::Connection) -> bool
fn validate(&self, _conn: &mut Self::Connection) -> bool
Quickly determines a connection is still valid when check-in.
Auto Trait Implementations§
impl<C> Freeze for AsyncDieselConnectionManager<C>
impl<C> !RefUnwindSafe for AsyncDieselConnectionManager<C>
impl<C> Send for AsyncDieselConnectionManager<C>
impl<C> Sync for AsyncDieselConnectionManager<C>
impl<C> Unpin for AsyncDieselConnectionManager<C>
impl<C> !UnwindSafe for AsyncDieselConnectionManager<C>
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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> Conn::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> Conn::ExecuteFuture<'conn, 'query>
Executes the given command, returning the number of rows affected. Read more
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Source§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> GetResult<'conn, 'query, Self, Conn, U>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> GetResult<'conn, 'query, Self, Conn, U>
Runs the command, and returns the affected row. Read more
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
Runs the command, returning an
Vec
with the affected rows. Read more