pub struct PostgresAuthUserRepository { /* private fields */ }Implementations§
Source§impl PostgresAuthUserRepository
impl PostgresAuthUserRepository
pub fn new(pool: DbPool) -> Self
pub fn new_with_session_cache( pool: DbPool, session_cache: Option<Arc<dyn SessionCache>>, ) -> Self
pub async fn create_dev_session( &self, user_id: AuthUserId, session_id: String, token: String, created_at: DateTime<Utc>, expires_at: DateTime<Utc>, ) -> AppResult<AuthSession>
pub async fn revoke_session_token( &self, token: &str, revoked_at: DateTime<Utc>, ) -> AppResult<bool>
Trait Implementations§
Source§impl AuthUserRepository for PostgresAuthUserRepository
impl AuthUserRepository for PostgresAuthUserRepository
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 AuthUser,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: &'life1 AuthUserId,
) -> Pin<Box<dyn Future<Output = AppResult<Option<AuthUser>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: i64,
cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<AuthUser>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_session_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = AppResult<Option<AuthSessionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_sessions<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: i64,
cursor: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = AppResult<Vec<AuthSessionRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_session_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
revoked_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = AppResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_user_disabled_at<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 AuthUserId,
disabled_at: Option<DateTime<Utc>>,
disabled_reason: Option<&'life2 str>,
disabled_until: Option<DateTime<Utc>>,
) -> Pin<Box<dyn Future<Output = AppResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Clone for PostgresAuthUserRepository
impl Clone for PostgresAuthUserRepository
Source§fn clone(&self) -> PostgresAuthUserRepository
fn clone(&self) -> PostgresAuthUserRepository
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 PostgresAuthUserRepository
impl !UnwindSafe for PostgresAuthUserRepository
impl Freeze for PostgresAuthUserRepository
impl Send for PostgresAuthUserRepository
impl Sync for PostgresAuthUserRepository
impl Unpin for PostgresAuthUserRepository
impl UnsafeUnpin for PostgresAuthUserRepository
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§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