Skip to main content

InvitationStore

Trait InvitationStore 

Source
pub trait InvitationStore: Send + Sync {
Show 13 methods // Required methods fn create_invitation<'life0, 'async_trait>( &'life0 self, invitation: CreateInvitation, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_invitation_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_pending_invitation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, org_id: &'life1 str, email: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update_invitation_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, status: InvitationStatus, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_organization_invitations<'life0, 'life1, 'async_trait>( &'life0 self, org_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn count_pending_organization_invitations<'life0, 'life1, 'async_trait>( &'life0 self, org_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_user_invitations<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn create_invitation_with_options<'life0, 'async_trait>( &'life0 self, invitation: CreateInvitation, options: InvitationCreateOptions, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn pending_invitation_page<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _org_id: &'life1 str, _email: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn update_invitation_expiry<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _expires_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn update_invitation_status_if_status<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _expected: InvitationStatus, _status: InvitationStatus, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn accept_invitation_with_teams<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _invitation_id: &'life1 str, _user_id: &'life2 str, _session_token: &'life3 str, _team_limits: &'life4 [(String, Option<f64>)], _membership_limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<(Invitation, Member)>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait { ... } fn update_invitation_team_ids<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _team_ids: Option<String>, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}

Required Methods§

Source

fn create_invitation<'life0, 'async_trait>( &'life0 self, invitation: CreateInvitation, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_invitation_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_pending_invitation<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, org_id: &'life1 str, email: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn update_invitation_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, status: InvitationStatus, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_organization_invitations<'life0, 'life1, 'async_trait>( &'life0 self, org_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn count_pending_organization_invitations<'life0, 'life1, 'async_trait>( &'life0 self, org_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count still-pending, unexpired invitations for an organization.

Source

fn list_user_invitations<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn create_invitation_with_options<'life0, 'async_trait>( &'life0 self, invitation: CreateInvitation, options: InvitationCreateOptions, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn pending_invitation_page<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _org_id: &'life1 str, _email: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Actual adapter page of pending rows, before expiry filtering.

Source

fn update_invitation_expiry<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _expires_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update expiry independently; reissue retains every other invitation field.

Source

fn update_invitation_status_if_status<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _expected: InvitationStatus, _status: InvitationStatus, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Invitation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically change only an invitation still at the expected status and return the actual updated row. A mismatch or missing row returns None. This write commits independently of a later membership transaction.

Source

fn accept_invitation_with_teams<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _invitation_id: &'life1 str, _user_id: &'life2 str, _session_token: &'life3 str, _team_limits: &'life4 [(String, Option<f64>)], _membership_limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<(Invitation, Member)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Claim a pending invitation and persist memberships/session scope in one transition.

Source

fn update_invitation_team_ids<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _team_ids: Option<String>, ) -> Pin<Box<dyn Future<Output = AuthResult<Invitation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§