Skip to main content

DynActiveRelationSource

Trait DynActiveRelationSource 

Source
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§

Source

type Error: Error + Send + Sync + 'static

Source-specific error type.

Required Methods§

Source

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.

Source

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.

Source

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".

Implementors§