Trait FromServerContext

Source
pub trait FromServerContext<I = ()>: Sized {
    type Rejection;

    // Required method
    fn from_request<'life0, 'async_trait>(
        req: &'life0 DioxusServerContext,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature server only.
Expand description

A trait for extracting types from the server context

Required Associated Types§

Source

type Rejection

The error type returned when extraction fails. This type must implement std::error::Error.

Required Methods§

Source

fn from_request<'life0, 'async_trait>( req: &'life0 DioxusServerContext, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extract this type from the server context.

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<I: FromRequestParts<()>> FromServerContext<Axum> for I

Source§

impl<T: Send + Sync + Clone + 'static> FromServerContext for FromContext<T>

Source§

type Rejection = NotFoundInServerContext<T>