pub struct PostgresMandateRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl MandateRepository for PostgresMandateRepository
impl MandateRepository for PostgresMandateRepository
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
mandate: &'life1 Mandate,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
mandate: &'life1 Mandate,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a freshly issued mandate.
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Look up a mandate by its primary key.
Source§fn list_active_for_subject<'life0, 'async_trait>(
&'life0 self,
subject_user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_active_for_subject<'life0, 'async_trait>(
&'life0 self,
subject_user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all currently active (non-revoked, within validity window)
mandates whose subject is the given user.
Source§fn list_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 MandateScope,
) -> Pin<Box<dyn Future<Output = Result<Vec<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 MandateScope,
) -> Pin<Box<dyn Future<Output = Result<Vec<Mandate>, AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all mandates that target the given scope (regardless of status).
Useful for syndic audit views.
Source§fn revoke<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
revoked_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn revoke<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
revoked_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Atomically revoke a mandate. Implementation MUST do
UPDATE ... SET revoked_at = $2 WHERE id = $1 AND revoked_at IS NULL
so a double-revoke is a no-op (idempotent).Auto Trait Implementations§
impl !RefUnwindSafe for PostgresMandateRepository
impl !UnwindSafe for PostgresMandateRepository
impl Freeze for PostgresMandateRepository
impl Send for PostgresMandateRepository
impl Sync for PostgresMandateRepository
impl Unpin for PostgresMandateRepository
impl UnsafeUnpin for PostgresMandateRepository
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
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.