Skip to main content

ModuleRegistry

Trait ModuleRegistry 

Source
pub trait ModuleRegistry: Send + Sync {
    // Required methods
    fn list_enabled<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Module>, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn enable<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
        module: Module,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn disable<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
        module: Module,
    ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_enabled<'life0, 'async_trait>(
        &'life0 self,
        acp_id: Uuid,
        module: Module,
    ) -> Pin<Box<dyn Future<Output = Result<bool, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn list_enabled<'life0, 'async_trait>( &'life0 self, acp_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Module>, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Les modules actifs (archived_at IS NULL) d’une ACP.

Une ACP inconnue rend une liste vide, pas une erreur : la garde de portée s’exécute avant et c’est elle qui décide si l’appelant a le droit de savoir que l’ACP n’existe pas.

Source

fn enable<'life0, 'async_trait>( &'life0 self, acp_id: Uuid, module: Module, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Allume un module. Idempotent : rallumer un module déjà actif remet simplement archived_at à NULL et ne duplique pas la ligne — c’est ce qui permet le cycle activer/désactiver/réactiver d’INV-27 sans perdre les données.

Source

fn disable<'life0, 'async_trait>( &'life0 self, acp_id: Uuid, module: Module, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Éteint un module. Idempotent également. Ne supprime rien : pose archived_at. Le refus d’éteindre identity est une règle métier et vit dans le use-case, pas ici.

Source

fn is_enabled<'life0, 'async_trait>( &'life0 self, acp_id: Uuid, module: Module, ) -> Pin<Box<dyn Future<Output = Result<bool, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Chemin chaud : appelé par ModuleGuard à chaque requête gardée.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§