kvarn::extensions

Trait PackageCall

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

Implement this to pass your extension to Extensions::add_package.

Required Methods§

source

fn call<'a>( &'a self, response: &'a mut Response<()>, request: &'a FatRequest, host: &'a Host, addr: SocketAddr, ) -> RetFut<'a, ()>

§Arguments
  • A mutable reference to a Response without the body.
  • An immutable reference to the request.
  • An immutable reference to the host this request is to.

Implementors§

source§

impl<F: for<'a> Fn(&'a mut Response<()>, &'a FatRequest, &'a Host, SocketAddr) -> RetFut<'a, ()> + KvarnSendSync> PackageCall for F