Skip to main content

FromConn

Trait FromConn 

Source
pub trait FromConn:
    Send
    + Sync
    + Sized
    + 'static {
    // Required method
    fn from_conn(conn: &mut Conn) -> impl Future<Output = Option<Self>> + Send;
}
Expand description

A trait to extract content from [Conn]s to be used as the second argument to an api handler. Implement this for your types.

Required Methods§

Source

fn from_conn(conn: &mut Conn) -> impl Future<Output = Option<Self>> + Send

returning None from this will not call the api handler, but will halt the conn.

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§

Source§

impl FromConn for ()

Source§

async fn from_conn(_: &mut Conn) -> Option<Self>

Source§

impl FromConn for Headers

Source§

async fn from_conn(conn: &mut Conn) -> Option<Self>

Source§

impl FromConn for Method

Source§

async fn from_conn(conn: &mut Conn) -> Option<Self>

Source§

impl FromConn for Version

Source§

async fn from_conn(conn: &mut Conn) -> Option<Self>

Source§

impl<E: FromConn> FromConn for Option<E>

Source§

async fn from_conn(conn: &mut Conn) -> Option<Self>

Source§

impl<T, E> FromConn for Result<T, E>
where T: TryFromConn<Error = E>, E: Send + Sync + 'static,

Source§

async fn from_conn(conn: &mut Conn) -> Option<Self>

Implementors§

Source§

impl FromConn for Error

Source§

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