rama::http::dep::core::service::handler

Trait FromContextRequest

pub trait FromContextRequest<State, Request>: Send + 'static {
    // Required method
    fn from_context_request(ctx: Context<State>, req: Request) -> Self;
}
Expand description

Convert a context+request into a parameter for the ServiceFn handler function.

Required Methods§

fn from_context_request(ctx: Context<State>, req: Request) -> Self

Convert a context+request into a parameter for the ServiceFn handler function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<State, Request> FromContextRequest<State, Request> for ((), Request)
where State: Clone + Send + Sync + 'static, Request: Send + 'static,

§

fn from_context_request(_ctx: Context<State>, req: Request) -> ((), Request)

§

impl<State, Request> FromContextRequest<State, Request> for (Context<State>, Request)
where State: Clone + Send + Sync + 'static, Request: Send + 'static,

§

fn from_context_request( ctx: Context<State>, req: Request, ) -> (Context<State>, Request)

§

impl<State, Request> FromContextRequest<State, Request> for ()

§

fn from_context_request(_ctx: Context<State>, _req: Request)

Implementors§