pub struct Server { /* private fields */ }Expand description
The http server
Implementations
sourceimpl Server
impl Server
sourcepub fn set_uri(&self, uri: &str) -> &Self
pub fn set_uri(&self, uri: &str) -> &Self
Allows to set the listener uri (supported format is
sourcepub fn configure_router<F>(&self, config_fn: F) -> &Selfwhere
F: Fn(&Router),
pub fn configure_router<F>(&self, config_fn: F) -> &Selfwhere
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.
sourcepub fn configure_middlewares<F>(&self, config_fn: F) -> &Selfwhere
F: Fn(&MiddlewareStack),
pub fn configure_middlewares<F>(&self, config_fn: F) -> &Selfwhere
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.
sourcepub fn configure_listener<F>(&self, config_fn: F) -> &Selfwhere
F: Fn(&mut ListenerConfig),
pub fn configure_listener<F>(&self, config_fn: F) -> &Selfwhere
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.
sourcepub fn spawn(&self, executor: TaskExecutor) -> Result<ServerSpawn, ServerError>
pub fn spawn(&self, executor: TaskExecutor) -> Result<ServerSpawn, ServerError>
Spawn the server inside the provided executor and return a ServerSpawn context to explicitly terminate it.
sourcepub fn run(&self) -> Result<(), ServerError>
pub fn run(&self) -> Result<(), ServerError>
This method will run until the server terminates.
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl Send for Server
impl !Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more