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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PostgresStorage
impl Debug for PostgresStorage
Source§impl MagicLinkStorage for PostgresStorage
impl MagicLinkStorage for PostgresStorage
type Error = StorageError
fn save_magic_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 MagicToken,
) -> Pin<Box<dyn Future<Output = Result<(), <Self as MagicLinkStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_magic_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MagicToken>, <Self as MagicLinkStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_magic_token_used<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), <Self as MagicLinkStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl OAuthStorage for PostgresStorage
impl OAuthStorage for PostgresStorage
type Error = StorageError
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, <Self as OAuthStorage>::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, <Self as OAuthStorage>::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<(), <Self as OAuthStorage>::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<(), <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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>, <Self as OAuthStorage>::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<(), <Self as OAuthStorage>::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<(), <Self as OAuthStorage>::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
type Error = StorageError
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<(), <Self as PasskeyStorage>::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<(), <Self as PasskeyStorage>::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>, <Self as PasskeyStorage>::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>, <Self as PasskeyStorage>::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>, <Self as PasskeyStorage>::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>, <Self as PasskeyStorage>::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<(), <Self as PasskeyStorage>::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<(), <Self as PasskeyStorage>::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§fn get_passkey_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
challenge_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, <Self as PasskeyStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_passkey_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
challenge_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, <Self as PasskeyStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a passkey challenge
Source§impl PasswordStorage for PostgresStorage
impl PasswordStorage for PostgresStorage
type Error = StorageError
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<(), <Self as PasswordStorage>::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<(), <Self as PasswordStorage>::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§fn get_password_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, <Self as PasswordStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_password_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 UserId,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, <Self as PasswordStorage>::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a user’s password hash
Source§impl SessionStorage for PostgresStorage
impl SessionStorage for PostgresStorage
type Error = Error
fn create_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<Session, Self::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>, Self::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<(), Self::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<(), Self::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<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl UserStorage for PostgresStorage
impl UserStorage for PostgresStorage
type Error = Error
fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 NewUser,
) -> Pin<Box<dyn Future<Output = Result<User, Self::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>, Self::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>, Self::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, Self::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, Self::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<(), Self::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<(), Self::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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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