pub struct WebIo { /* private fields */ }Expand description
The central Application controller. Manages routing, middleware, and the internal TCP lifecycle.
Implementations§
Source§impl WebIo
impl WebIo
Sourcepub fn use_mw<F>(&mut self, f: F)
pub fn use_mw<F>(&mut self, f: F)
Registers a global middleware function.
If the middleware returns Some(Reply), the request cycle ends early.
Sourcepub fn on_404<F, Fut>(&mut self, handler: F)
pub fn on_404<F, Fut>(&mut self, handler: F)
Configures custom 404 handlers.
It intelligently detects Content-Type to serve JSON or HTML based on the client’s Accept header.
Auto Trait Implementations§
impl Freeze for WebIo
impl !RefUnwindSafe for WebIo
impl Send for WebIo
impl Sync for WebIo
impl Unpin for WebIo
impl !UnwindSafe for WebIo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more