Skip to main content

FromRequest

Trait FromRequest 

Source
pub trait FromRequest<State>: Sized {
    type Rejection: IntoResponse;

    // Required method
    fn from_request(
        ctx: &mut RequestContext,
        state: &Arc<State>,
    ) -> impl Future<Output = Result<Self, Self::Rejection>> + Send;
}
Expand description

Extract a typed value from a request context.

Required Associated Types§

Required Methods§

Source

fn from_request( ctx: &mut RequestContext, state: &Arc<State>, ) -> impl Future<Output = Result<Self, Self::Rejection>> + Send

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.

Implementors§

Source§

impl<State> FromRequest<State> for ClientId
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for Cmd
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for Command
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for Extensions
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for LocalAddr
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for PeerAddr
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for PubSubHandle
where State: Send + Sync + 'static,

Source§

impl<State> FromRequest<State> for PushHandle
where State: Send + Sync + 'static,

Source§

impl<T> FromRequest<T> for State<T>
where T: Send + Sync + 'static,