Struct saphir::BasicController[][src]

pub struct BasicController<C> { /* fields omitted */ }

An helper struct embedding a ControllerDispatch.

Methods

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

Add a delegate function to handle a particular request

Example

let u8_context = 1;
let u8_controller = BasicController::new(u8_context);
u8_controller.add(Method::Get, "^/test$", |ctx, req, res| { println!("this will handle Get request done on <your_host>/test")});

Add a delegate function to handle a particular request

Example

let u8_context = 1;
let u8_controller = BasicController::new(u8_context);
u8_controller.add(Method::Get, "^/test$", |ctx, req, res| { println!("this will handle Get request done on <your_host>/test")});

Trait Implementations

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

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. Read more

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

Auto Trait Implementations

impl<C> Send for BasicController<C>

impl<C> Sync for BasicController<C>