soaprs_core/use_case.rs
1//! Application use-case contract.
2
3use crate::{BoxFuture, SoapResult};
4
5/// An object-safe asynchronous application operation.
6pub trait UseCase: Send + Sync {
7 /// Input accepted by the operation.
8 type Input: Send;
9 /// Successful output produced by the operation.
10 type Output: Send;
11
12 /// Executes the use case.
13 fn execute(&self, input: Self::Input) -> BoxFuture<'_, SoapResult<Self::Output>>;
14}