pub struct Pool { /* private fields */ }Expand description
Database connection pool.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn acquire(
&self,
) -> impl Future<Output = Result<PoolConnection, Error>> + '_
pub fn acquire( &self, ) -> impl Future<Output = Result<PoolConnection, Error>> + '_
Acquire a read-only database connection.
Sourcepub fn begin_read(
&self,
) -> impl Future<Output = Result<ReadTransaction, Error>> + '_
pub fn begin_read( &self, ) -> impl Future<Output = Result<ReadTransaction, Error>> + '_
Begin a read-only transaction. See ReadTransaction for more details.
Sourcepub fn begin_write(
&self,
) -> impl Future<Output = Result<WriteTransaction, Error>> + '_
pub fn begin_write( &self, ) -> impl Future<Output = Result<WriteTransaction, Error>> + '_
Begin a write transaction. See WriteTransaction for more details.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl !RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more