pub trait FamilyStore: Send + Sync {
// Required methods
fn create_family<'life0, 'async_trait>(
&'life0 self,
family: Family,
owner: FamilyMember,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_families<'life0, 'async_trait>(
&'life0 self,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Family>, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<Option<Family>, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn rename_family<'life0, 'life1, 'async_trait>(
&'life0 self,
family_id: FamilyId,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Family, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_members<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<Vec<FamilyMember>, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_member<'life0, 'async_trait>(
&'life0 self,
member: FamilyMember,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_member<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn leave_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn change_member_role<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
role: FamilyRole,
) -> Pin<Box<dyn Future<Output = Result<FamilyMember, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn change_member_relationship<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
relationship: FamilyRelationship,
) -> Pin<Box<dyn Future<Output = Result<FamilyMember, FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn transfer_ownership<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
current_owner: UserId,
new_owner: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Family persistence operations. Methods that affect ownership or family lifecycle are atomic; implementations must preserve exactly one owner.
Required Methods§
fn create_family<'life0, 'async_trait>(
&'life0 self,
family: Family,
owner: FamilyMember,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_families<'life0, 'async_trait>(
&'life0 self,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Family>, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<Option<Family>, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rename_family<'life0, 'life1, 'async_trait>(
&'life0 self,
family_id: FamilyId,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Family, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_members<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
) -> Pin<Box<dyn Future<Output = Result<Vec<FamilyMember>, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_member<'life0, 'async_trait>(
&'life0 self,
member: FamilyMember,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_member<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn leave_family<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn change_member_role<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
role: FamilyRole,
) -> Pin<Box<dyn Future<Output = Result<FamilyMember, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn change_member_relationship<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
user_id: UserId,
relationship: FamilyRelationship,
) -> Pin<Box<dyn Future<Output = Result<FamilyMember, FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transfer_ownership<'life0, 'async_trait>(
&'life0 self,
family_id: FamilyId,
current_owner: UserId,
new_owner: UserId,
) -> Pin<Box<dyn Future<Output = Result<(), FamilyStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".