Skip to main content

IEndpoint

Trait IEndpoint 

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

An endpoint handler is the terminal component in the middleware pipeline.

Analogous to ASP.NET Core’s RequestDelegate at the endpoint level.

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IEndpoint for HealthCheckEndpoint

Source§

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

Source§

impl IEndpoint for MetricsEndpoint

Source§

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

Source§

impl IEndpoint for StubEndpoint

Source§

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

Implementors§