Expand description
Handler traits: IRequestHandler and IEventHandler.
§IRequestHandler<T, R>
Dual-type-parameter handler: T is the request type, R is the response type.
The constraint T: IRequest<R> ensures type safety between request and response.
ⓘ
#[async_trait]
impl IRequestHandler<GetUserRequest, UserModel> for GetUserHandler {
async fn handle(&self, req: GetUserRequest) -> Result<UserModel> { ... }
}Traits§
- IEvent
Handler - Handles a single
IEventRequest, performing side effects. - IHosted
Service - Background service that is started when the host starts and stopped when the host performs a graceful shutdown.
- IRequest
Handler - Handles a single
IRequest<R>, producing its associated responseR.