pub struct TokioPostgresConnection { /* private fields */ }Expand description
Shared tokio-postgres client handle and transaction gate.
Both crate::TokioPostgresAdapter and
crate::TokioPostgresRateLimitStore must use the same connection bundle
when they operate on the same physical Postgres connection. The gate
serializes explicit transactions, schema migrations, and rate-limit
consume operations so they cannot interleave on the shared client.
Implementations§
Source§impl TokioPostgresConnection
impl TokioPostgresConnection
Sourcepub fn from_client(client: Client) -> Self
pub fn from_client(client: Client) -> Self
Wraps an application-owned client and a fresh transaction gate.
Sourcepub async fn connect(database_url: &str) -> Result<Self, RustAuthError>
pub async fn connect(database_url: &str) -> Result<Self, RustAuthError>
Connects to Postgres and spawns the tokio-postgres connection driver.
Trait Implementations§
Source§impl Clone for TokioPostgresConnection
impl Clone for TokioPostgresConnection
Source§fn clone(&self) -> TokioPostgresConnection
fn clone(&self) -> TokioPostgresConnection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for TokioPostgresConnection
impl !UnwindSafe for TokioPostgresConnection
impl Freeze for TokioPostgresConnection
impl Send for TokioPostgresConnection
impl Sync for TokioPostgresConnection
impl Unpin for TokioPostgresConnection
impl UnsafeUnpin for TokioPostgresConnection
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