pub trait UserRoleRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
assignment: &'life1 UserRoleAssignment,
) -> Pin<Box<dyn Future<Output = Result<UserRoleAssignment, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_for_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_for_users<'life0, 'life1, 'async_trait>(
&'life0 self,
user_ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = Result<HashMap<Uuid, Vec<UserRoleAssignment>>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn replace_all<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Uuid,
assignments: &'life1 [UserRoleAssignment],
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserRoleAssignment>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_primary_role<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
role_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<UserRoleAssignment, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
assignment: &'life1 UserRoleAssignment,
) -> Pin<Box<dyn Future<Output = Result<UserRoleAssignment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_for_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserRoleAssignment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_for_users<'life0, 'life1, 'async_trait>(
&'life0 self,
user_ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = Result<HashMap<Uuid, Vec<UserRoleAssignment>>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn replace_all<'life0, 'life1, 'async_trait>(
&'life0 self,
user_id: Uuid,
assignments: &'life1 [UserRoleAssignment],
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserRoleAssignment>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_primary_role<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
role_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<UserRoleAssignment, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn delete_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a single role assignment by id.
Story B0bis — gap fill for Story 3.1: the CRUD REST endpoint
DELETE /users/{user_id}/role-assignments/{id} revokes a single row
without rewriting the whole set. Returns true if a row was deleted,
false if no row matched.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".