pub trait Usecase {
type Input;
type Output;
type Error: Debug;
// Required methods
fn new(make: &MakeUsecase) -> Self;
fn authorize(
&self,
principal: Principal,
input: &Self::Input
) -> impl Future<Output = Result<Principal, Unauthorized>>;
fn usecase(
&self,
input: Input<Self::Input>
) -> impl Future<Output = Result<Output<Self::Output>, Error<Self::Error>>>;
// Provided method
fn audit_operation(&self) -> &'static str { ... }
}
Required Associated Types§
Required Methods§
fn new(make: &MakeUsecase) -> Self
Authorize given principal
Provided Methods§
fn audit_operation(&self) -> &'static str
Object Safety§
This trait is not object safe.