pub struct RouterBuilder { /* private fields */ }Expand description
Builder for constructing a Router instance with fluent method helpers.
Implementations§
Source§impl RouterBuilder
impl RouterBuilder
Sourcepub fn auto_head(self, enabled: bool) -> Self
pub fn auto_head(self, enabled: bool) -> Self
Configure whether HEAD requests should automatically reuse GET handlers.
Sourcepub fn route<H>(
self,
method: Method,
path: impl Into<String>,
handler: H,
) -> Selfwhere
H: Handler,
pub fn route<H>(
self,
method: Method,
path: impl Into<String>,
handler: H,
) -> Selfwhere
H: Handler,
Register a handler for an arbitrary method token.
Sourcepub fn get<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn get<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a GET handler.
Sourcepub fn head<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn head<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a HEAD handler.
Sourcepub fn post<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn post<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a POST handler.
Sourcepub fn put<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn put<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a PUT handler.
Sourcepub fn delete<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn delete<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a DELETE handler.
Sourcepub fn options<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn options<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register an OPTIONS handler.
Sourcepub fn trace<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
pub fn trace<H>(self, path: impl Into<String>, handler: H) -> Selfwhere
H: Handler,
Register a TRACE handler.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RouterBuilder
impl !UnwindSafe for RouterBuilder
impl Freeze for RouterBuilder
impl Send for RouterBuilder
impl Sync for RouterBuilder
impl Unpin for RouterBuilder
impl UnsafeUnpin for RouterBuilder
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