Skip to main content

OrgRepository

Trait OrgRepository 

Source
pub trait OrgRepository:
    Send
    + Sync
    + 'static {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        data: CreateOrg,
    ) -> Pin<Box<dyn Future<Output = Result<Organization>> + 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<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_slug<'life0, 'life1, 'async_trait>(
        &'life0 self,
        slug: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Organization>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_member<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
        user_id: Uuid,
        role_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Membership>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_member<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
        user_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_members<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Membership>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_roles<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Role>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_role<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
        name: String,
        permissions: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Role>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_member_role<'life0, 'async_trait>(
        &'life0 self,
        org_id: Uuid,
        user_id: Uuid,
        role_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Membership>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn create<'life0, 'async_trait>( &'life0 self, data: CreateOrg, ) -> Pin<Box<dyn Future<Output = Result<Organization>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Organization>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn add_member<'life0, 'async_trait>( &'life0 self, org_id: Uuid, user_id: Uuid, role_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Membership>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn remove_member<'life0, 'async_trait>( &'life0 self, org_id: Uuid, user_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_members<'life0, 'async_trait>( &'life0 self, org_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Membership>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn find_roles<'life0, 'async_trait>( &'life0 self, org_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Role>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn create_role<'life0, 'async_trait>( &'life0 self, org_id: Uuid, name: String, permissions: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Role>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_member_role<'life0, 'async_trait>( &'life0 self, org_id: Uuid, user_id: Uuid, role_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Membership>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§