soaprs-core 0.2.0

Core contracts for soaprs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Application use-case contract.

use crate::{BoxFuture, SoapResult};

/// An object-safe asynchronous application operation.
pub trait UseCase: Send + Sync {
    /// Input accepted by the operation.
    type Input: Send;
    /// Successful output produced by the operation.
    type Output: Send;

    /// Executes the use case.
    fn execute(&self, input: Self::Input) -> BoxFuture<'_, SoapResult<Self::Output>>;
}