pub struct PostgresStorage { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl Clone for PostgresStorage
impl Clone for PostgresStorage
Source§fn clone(&self) -> PostgresStorage
fn clone(&self) -> PostgresStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PostgresStorage
impl Debug for PostgresStorage
Source§impl OAuthStorage for PostgresStorage
impl OAuthStorage for PostgresStorage
Source§fn create_oauth_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
user_id: &'life3 UserId,
) -> Pin<Box<dyn Future<Output = Result<OAuthAccount, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_oauth_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
user_id: &'life3 UserId,
) -> Pin<Box<dyn Future<Output = Result<OAuthAccount, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a new OAuth account linked to a user
Source§fn store_pkce_verifier<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
csrf_state: &'life1 str,
pkce_verifier: &'life2 str,
expires_in: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn store_pkce_verifier<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
csrf_state: &'life1 str,
pkce_verifier: &'life2 str,
expires_in: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a PKCE verifier with an expiration time
Source§fn get_pkce_verifier<'life0, 'life1, 'async_trait>(
&'life0 self,
csrf_state: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_pkce_verifier<'life0, 'life1, 'async_trait>(
&'life0 self,
csrf_state: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a stored PKCE verifier by CSRF state
Source§fn get_oauth_account_by_provider_and_subject<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<OAuthAccount>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_oauth_account_by_provider_and_subject<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<OAuthAccount>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find an OAuth account by provider and subject
Source§fn get_user_by_provider_and_subject<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_user_by_provider_and_subject<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
provider: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find a user by their OAuth provider and subject
Source§fn link_oauth_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
provider: &'life2 str,
subject: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn link_oauth_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
provider: &'life2 str,
subject: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Link an existing user to an OAuth account
Source§impl PasskeyStorage for PostgresStorage
impl PasskeyStorage for PostgresStorage
Source§fn add_passkey<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
credential_id: &'life2 str,
passkey_json: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_passkey<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
credential_id: &'life2 str,
passkey_json: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a passkey credential for a user
Source§fn get_passkey_by_credential_id<'life0, 'life1, 'async_trait>(
&'life0 self,
credential_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_passkey_by_credential_id<'life0, 'life1, 'async_trait>(
&'life0 self,
credential_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a passkey by credential ID
Source§fn get_passkeys<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_passkeys<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all passkeys for a user
Source§fn set_passkey_challenge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
challenge_id: &'life1 str,
challenge: &'life2 str,
expires_in: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_passkey_challenge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
challenge_id: &'life1 str,
challenge: &'life2 str,
expires_in: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Set a passkey challenge for a user
Source§impl PasswordStorage for PostgresStorage
impl PasswordStorage for PostgresStorage
Source§fn set_password_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
hash: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_password_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
hash: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a password hash for a user
Source§impl SessionStorage for PostgresStorage
impl SessionStorage for PostgresStorage
fn create_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<Session, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 SessionToken,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cleanup_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_sessions_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl UserStorage for PostgresStorage
impl UserStorage for PostgresStorage
fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 NewUser,
) -> Pin<Box<dyn Future<Output = Result<User, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_or_create_user_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<User, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_user_email_verified<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for PostgresStorage
impl !RefUnwindSafe for PostgresStorage
impl Send for PostgresStorage
impl Sync for PostgresStorage
impl Unpin for PostgresStorage
impl !UnwindSafe for PostgresStorage
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