Struct sapper::SapperApp
[−]
[src]
pub struct SapperApp { pub address: String, pub port: u32, pub shell: Option<Arc<Box<SapperAppShell + Send + Sync + 'static>>>, pub routers: Router, pub static_service: bool, pub init_closure: Option<Arc<Box<Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>>>, pub not_found: Option<String>, }
Fields
address: String
port: u32
shell: Option<Arc<Box<SapperAppShell + Send + Sync + 'static>>>
routers: Router
static_service: bool
init_closure: Option<Arc<Box<Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>>>
not_found: Option<String>
Methods
impl SapperApp
[src]
fn new() -> SapperApp
[src]
fn address(&mut self, address: &str) -> &mut Self
[src]
fn port(&mut self, port: u32) -> &mut Self
[src]
fn static_service(&mut self, open: bool) -> &mut Self
[src]
fn with_shell(
&mut self,
w: Box<SapperAppShell + Send + Sync + 'static>
) -> &mut Self
[src]
&mut self,
w: Box<SapperAppShell + Send + Sync + 'static>
) -> &mut Self
fn init_global(
&mut self,
clos: Box<Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>
) -> &mut Self
[src]
&mut self,
clos: Box<Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>
) -> &mut Self
fn not_found_page(&mut self, page: String) -> &mut Self
[src]
fn add_module(&mut self, sm: Box<SapperModule>) -> &mut Self
[src]
fn run_http(self)
[src]
Trait Implementations
impl Handler for SapperApp
[src]
fn handle(&self, req: Request, res: Response)
[src]
Receives a Request
/Response
pair, and should perform some action on them. Read more
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]
Called when a Request includes a Expect: 100-continue
header. Read more
fn on_connection_start(&self)
[src]
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)
[src]
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