pub struct Pool { /* private fields */ }Implementations§
Source§impl Pool
impl Pool
pub async fn connect(params: ConnectParams) -> Result<Self, PgError>
pub async fn connect_with_config( params: ConnectParams, config: PoolConfig, ) -> Result<Self, PgError>
pub async fn get(&self) -> Result<PooledConnection, PgError>
pub async fn begin(&self) -> Result<Transaction, PgError>
pub fn is_closed(&self) -> bool
pub async fn close(&self)
Trait Implementations§
Source§impl Queryer for Pool
impl Queryer for Pool
async fn query_raw( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<Vec<Row>, PgError>
async fn execute_raw( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<u64, PgError>
async fn query<T: FromSql>( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<Vec<Vec<T>>, PgError>
async fn query_as<T: FromRow>( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<Vec<T>, PgError>
async fn query_one_as<T: FromRow>( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<T, PgError>
async fn query_first_as<T: FromRow>( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<Option<T>, PgError>
async fn query_first<T: FromSql>( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<Option<T>, PgError>
Auto Trait Implementations§
impl !RefUnwindSafe for Pool
impl !UnwindSafe for Pool
impl Freeze for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
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