Skip to main content

OrganizationStore

Trait OrganizationStore 

Source
pub trait OrganizationStore: Send + Sync {
    // Required methods
    fn create_organization<'life0, 'async_trait>(
        &'life0 self,
        org: CreateOrganization,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Organization>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_organization_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_organization_by_slug<'life0, 'life1, 'async_trait>(
        &'life0 self,
        slug: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_organizations_by_ids<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ids: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_organization<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        update: UpdateOrganization,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Organization>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_organization<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_user_organizations<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn patch_organization_if_present<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _id: &'life1 str,
        _update: UpdateOrganization,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn update_organization_if_present<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _id: &'life1 str,
        _update: UpdateOrganization,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn create_organization<'life0, 'async_trait>( &'life0 self, org: CreateOrganization, ) -> Pin<Box<dyn Future<Output = AuthResult<Organization>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

fn list_organizations_by_ids<'life0, 'life1, 'async_trait>( &'life0 self, ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Organization>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch multiple organizations by id.

Implementations may return rows in any order. Callers must remap by id when response order matters.

Source

fn update_organization<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, update: UpdateOrganization, ) -> Pin<Box<dyn Future<Output = AuthResult<Organization>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Delete the organization and its members/invitations atomically. Extension rows (teams, roles, API keys) and sessions are retained, matching the pinned default adapter. Custom adapters own their constraint policy.

Source

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

Provided Methods§

Source

fn patch_organization_if_present<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _update: UpdateOrganization, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply exactly the supplied organization columns as a database patch. Returns absence separately from database errors. Empty patches are sent to the adapter rather than converted into timestamp-only updates. Custom stores serving the default HTTP update route must implement this bounded operation; the default fails closed with NotImplemented. Model callbacks belong to update_organization_if_present instead.

Source

fn update_organization_if_present<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, _update: UpdateOrganization, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Organization>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update a matching organization, retaining adapter model hooks. None means no row was updated; other storage failures remain errors. Custom stores must implement this optional-row operation explicitly.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§