Struct ocean::Application
[−]
[src]
pub struct Application { pub router: Router, pub context: Context, pub middleware: Middleware, pub public: Public, pub view: View, // some fields omitted }
Web application.
Fields
router: Router
Router.
context: Context
DynamicContext for template engine.
middleware: Middleware
Middleware.
public: Public
Public directory.
view: View
View setting.
Methods
impl Application
[src]
fn new() -> Application
Create a web application.
fn listen(self, ip: &str, port: usize)
Start application.
Trait Implementations
impl Default for Application
[src]
impl Handler for Application
[src]
fn handle<'a>(&'a self, http_req: HttpRequest, http_res: HttpResponse<'a>)
Receives a Request
/Response
pair, and should perform some action on them. Read more
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
Called when a Request includes a Expect: 100-continue
header. Read more
fn on_connection_start(&self)
This is run after a connection is received, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more
fn on_connection_end(&self)
This is run before a connection is closed, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more