pub struct AuthDb {
pub pool: PgPool,
}Expand description
PostgreSQL database wrapper for rs-auth storage backends.
Fields§
§pool: PgPoolSQLx PostgreSQL connection pool.
Implementations§
Trait Implementations§
Source§impl AccountStore for AuthDb
impl AccountStore for AuthDb
fn create_account<'life0, 'async_trait>(
&'life0 self,
account: NewAccount,
) -> Pin<Box<dyn Future<Output = Result<Account, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_provider<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider_id: &'life1 str,
account_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_by_user_id<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_account<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl SessionStore for AuthDb
impl SessionStore for AuthDb
fn create_session<'life0, 'async_trait>(
&'life0 self,
session: NewSession,
) -> Pin<Box<dyn Future<Output = Result<Session, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_token_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
token_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_user_id<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_session<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_by_user_id<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl UserStore for AuthDb
impl UserStore for AuthDb
fn create_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
email: &'life1 str,
name: Option<&'life2 str>,
password_hash: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<User, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn find_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_email_verified<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_password<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: i64,
password_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'async_trait>(
&'life0 self,
user_id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl VerificationStore for AuthDb
impl VerificationStore for AuthDb
fn create_verification<'life0, 'async_trait>(
&'life0 self,
verification: NewVerification,
) -> Pin<Box<dyn Future<Output = Result<Verification, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_identifier<'life0, 'life1, 'async_trait>(
&'life0 self,
identifier: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Verification>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_token_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
token_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Verification>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_verification<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_by_identifier<'life0, 'life1, 'async_trait>(
&'life0 self,
identifier: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for AuthDb
impl !RefUnwindSafe for AuthDb
impl Send for AuthDb
impl Sync for AuthDb
impl Unpin for AuthDb
impl UnsafeUnpin for AuthDb
impl !UnwindSafe for AuthDb
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,
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> 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