Skip to main content

IActionResult

Trait IActionResult 

Source
pub trait IActionResult: Send {
    // Required method
    fn execute<'life0, 'async_trait>(
        self: Box<Self>,
        ctx: &'life0 mut dyn IHttpContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

ASP.NET Core’s IActionResult: the action writes the response directly.

Implement this when none of the built-in results fit; return it boxed as Response. The transport applies whatever the result sets — status, headers, byte body or file body (the host then serves ranges, validators and chunked streams for file bodies).

Required Methods§

Source

fn execute<'life0, 'async_trait>( self: Box<Self>, ctx: &'life0 mut dyn IHttpContext, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Write this result into the response.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§