pub trait DynActiveRelationSource: Send + Sync {
type Error: Error + Send + Sync + 'static;
// Required methods
fn active_relations_for_subject<'a>(
&'a self,
subject: &'a SubjectRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>;
fn active_relations_for_subject_by_ids<'a>(
&'a self,
subject: &'a SubjectRef,
relation_ids: &'a [Uuid],
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>;
fn active_relations_for_subject_by_keys<'a>(
&'a self,
subject: &'a SubjectRef,
keys: &'a [RelationKey],
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>;
}Expand description
Object-safe active relation source for application composition boundaries.
This trait exists for places that genuinely need heterogeneous runtime
storage, such as Arc<dyn DynActiveRelationSource<Error = E>>. Prefer
ActiveRelationSource in reusable library APIs.
Required Associated Types§
Required Methods§
Sourcefn active_relations_for_subject<'a>(
&'a self,
subject: &'a SubjectRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
fn active_relations_for_subject<'a>( &'a self, subject: &'a SubjectRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
Finds active relation memberships for a subject.
Sourcefn active_relations_for_subject_by_ids<'a>(
&'a self,
subject: &'a SubjectRef,
relation_ids: &'a [Uuid],
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
fn active_relations_for_subject_by_ids<'a>( &'a self, subject: &'a SubjectRef, relation_ids: &'a [Uuid], ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
Finds active relation memberships for a subject, filtered by relation ids.
Sourcefn active_relations_for_subject_by_keys<'a>(
&'a self,
subject: &'a SubjectRef,
keys: &'a [RelationKey],
) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
fn active_relations_for_subject_by_keys<'a>( &'a self, subject: &'a SubjectRef, keys: &'a [RelationKey], ) -> Pin<Box<dyn Future<Output = Result<Vec<ActiveRelation>, Self::Error>> + Send + 'a>>
Finds active relation memberships for a subject, filtered by relation keys.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".