Skip to main content

IRequest

Trait IRequest 

Source
pub trait IRequest<TResponse>: Send + 'static
where TResponse: Serialize + Send + 'static,
{ }
Expand description

Marker trait for a request (command or query) carrying a structured response TResponse.

  • TResponse: Serialize → framework writes JSON and sets status 200
  • TResponse = () → framework writes no body and sets status 204
impl IRequest<UserModel> for GetUserRequest {}
impl IRequest<()> for DeleteUserRequest {}

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§