Struct svc_storage::postgres::PostgresPool
source · pub struct PostgresPool {
pub pool: Pool,
}
Expand description
Postgres Pool
Fields§
§pool: Pool
[Pool]
Implementations§
source§impl PostgresPool
impl PostgresPool
sourcepub fn from_config() -> Result<PostgresPool, ArrErr>
pub fn from_config() -> Result<PostgresPool, ArrErr>
Creates a new PostgresPool using configuration settings from the environment
use svc_storage::postgres::PostgresPool;
use svc_storage::common::ArrErr;
async fn example() -> Result<(), ArrErr> {
let pool = match PostgresPool::from_config() {
Ok(pg) => {
match pg.readiness().await {
Ok(_) => Ok(pg.pool),
Err(e) => Err(e),
}
},
Err(e) => Err(e)
};
Ok(())
}
Trait Implementations§
source§impl Debug for PostgresPool
impl Debug for PostgresPool
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresPool
impl Send for PostgresPool
impl Sync for PostgresPool
impl Unpin for PostgresPool
impl !UnwindSafe for PostgresPool
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
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request