kvarn::extensions

Trait PrepareCall

source
pub trait PrepareCall: KvarnSendSync {
    // Required method
    fn call<'a>(
        &'a self,
        request: &'a mut FatRequest,
        host: &'a Host,
        path: Option<&'a Path>,
        addr: SocketAddr,
    ) -> RetFut<'a, FatResponse>;
}
Expand description

Implement this to pass your extension to Extensions::add_prepare_fn or Extensions::add_prepare_single.

Required Methods§

source

fn call<'a>( &'a self, request: &'a mut FatRequest, host: &'a Host, path: Option<&'a Path>, addr: SocketAddr, ) -> RetFut<'a, FatResponse>

§Arguments
  • A mutable reference to the request.
  • An immutable reference to the host this request is to.
  • An Option of a Path. See the docs at prepare! for when this is None.
  • The SocketAddr of the requester.

Implementors§

source§

impl<F: for<'a> Fn(&'a mut FatRequest, &'a Host, Option<&Path>,