[][src]Trait sapper::Module

pub trait Module: Sync + Send {
    fn router(&self, _: &mut SapperRouter) -> Result<()>;

    fn before(&self, req: &mut SapperRequest) -> Result<()> { ... }
fn after(&self, req: &SapperRequest, res: &mut SapperResponse) -> Result<()> { ... } }

Sapper module trait 3 methods: before, after, router

Required methods

fn router(&self, _: &mut SapperRouter) -> Result<()>

module router method, used to write router collection of this module here

Loading content...

Provided methods

fn before(&self, req: &mut SapperRequest) -> Result<()>

module before filter, will be executed before handler

fn after(&self, req: &SapperRequest, res: &mut SapperResponse) -> Result<()>

module after filter, will be executed after handler

Loading content...

Implementors

Loading content...