[][src]Trait saphir::controller::Controller

pub trait Controller: Send + Sync {
    fn handle(&self, req: &mut SyncRequest, res: &mut SyncResponse);
fn base_path(&self) -> &str; }

Trait representing a controller

Required methods

fn handle(&self, req: &mut SyncRequest, res: &mut SyncResponse)

Method invoked if the request gets routed to this controller. Nothing will be processed after a controller handling a request. When returning from this function, the res param is the response returned to the client.

fn base_path(&self) -> &str

Method used by the router to know were to route a request addressed at a controller

Loading content...

Implementors

impl<C: Send + Sync> Controller for BasicController<C>[src]

Loading content...