pub trait ActiveRelationSource: Send + Sync {
type Error: Error + Send + Sync + 'static;
// Required methods
fn active_relations_for_subject<'a>(
&'a self,
subject: &'a SubjectRef,
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a;
fn active_relations_for_subject_by_ids<'a>(
&'a self,
subject: &'a SubjectRef,
relation_ids: &'a [RelationId],
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a;
fn active_relations_for_subject_by_keys<'a>(
&'a self,
subject: &'a SubjectRef,
keys: &'a [RelationKey],
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a;
}Expand description
Async read-side boundary for active relation state.
Prefer generic callers such as S: ActiveRelationSource for library and
adapter code. Use DynActiveRelationSource only where application
composition needs runtime erasure.
Required Associated Types§
Required Methods§
Sourcefn active_relations_for_subject<'a>(
&'a self,
subject: &'a SubjectRef,
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a
fn active_relations_for_subject<'a>( &'a self, subject: &'a SubjectRef, ) -> impl Future<Output = ProviderResult<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 [RelationId],
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a
fn active_relations_for_subject_by_ids<'a>( &'a self, subject: &'a SubjectRef, relation_ids: &'a [RelationId], ) -> impl Future<Output = ProviderResult<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],
) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a
fn active_relations_for_subject_by_keys<'a>( &'a self, subject: &'a SubjectRef, keys: &'a [RelationKey], ) -> impl Future<Output = ProviderResult<Vec<ActiveRelation>, Self::Error>> + Send + 'a
Finds active relation memberships for a subject, filtered by relation keys.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".