Skip to main content

DeliberationRepositoryPort

Trait DeliberationRepositoryPort 

Source
pub trait DeliberationRepositoryPort: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        deliberation: &'life1 Deliberation,
    ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<Deliberation, DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 TaskId,
    ) -> Pin<Box<dyn Future<Output = Result<bool, DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn save_authorized<'life0, 'life1, 'async_trait>(
        &'life0 self,
        deliberation: &'life1 Deliberation,
        authorization: Option<AuthorizationEvidence>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, deliberation: &'life1 Deliberation, ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist (or update) a deliberation keyed by its task id.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<Deliberation, DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a deliberation by task id. Returns DomainError::NotFound when absent.

Source

fn exists<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<bool, DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cheap existence check.

Provided Methods§

Source

fn save_authorized<'life0, 'life1, 'async_trait>( &'life0 self, deliberation: &'life1 Deliberation, authorization: Option<AuthorizationEvidence>, ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§