Struct saphir::Server [−][src]
pub struct Server { /* fields omitted */ }
The http server
Methods
impl Server
[src]
impl Server
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new http server
ⓘImportant traits for &'a mut Rpub fn set_uri(&self, uri: &str) -> &Self
[src]
ⓘImportant traits for &'a mut R
pub fn set_uri(&self, uri: &str) -> &Self
Allows to set the listener uri (supported format is
ⓘImportant traits for &'a mut Rpub fn configure_router<F>(&self, config_fn: F) -> &Self where
F: Fn(&Router),
[src]
ⓘImportant traits for &'a mut R
pub fn configure_router<F>(&self, config_fn: F) -> &Self where
F: Fn(&Router),
This method will call the provided closure with a mutable ref of the router Once into the closure it is possible to add controllers to the router.
ⓘImportant traits for &'a mut Rpub fn configure_middlewares<F>(&self, config_fn: F) -> &Self where
F: Fn(&MiddlewareStack),
[src]
ⓘImportant traits for &'a mut R
pub fn configure_middlewares<F>(&self, config_fn: F) -> &Self where
F: Fn(&MiddlewareStack),
This method will call the provided closure with a mutable ref of the middleware_stack Once into the closure it is possible to add middlewares to the middleware_stack.
ⓘImportant traits for &'a mut Rpub fn configure_listener<F>(&self, config_fn: F) -> &Self where
F: Fn(&mut ListenerConfig),
[src]
ⓘImportant traits for &'a mut R
pub fn configure_listener<F>(&self, config_fn: F) -> &Self where
F: Fn(&mut ListenerConfig),
This method will call the provided closure with a mutable ref of the listener configurations Once into the closure it is possible to set the uri and ssl file paths.
pub fn run(&self) -> Result<(), ServerError>
[src]
pub fn run(&self) -> Result<(), ServerError>
This method will run untill the server terminates.