[−][src]Struct webworker::router::Router
Fields
tree: PathTree<Box<dyn Fn(Request, Params) -> Response>>
Implementations
impl Router
[src]
pub fn new() -> Router
[src]
pub fn add(
&mut self,
method: &str,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
method: &str,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with method, path and the handler.
pub fn get(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with GET
method.
pub fn post(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with POST
method.
pub fn put(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with PUT
method.
pub fn patch(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with PATCH
method.
pub fn delete(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with DELETE
method.
pub fn connect(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with CONNECT
method.
pub fn head(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with HEAD
method.
pub fn options(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with OPTIONS
method.
pub fn trace(
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
[src]
&mut self,
path: &str,
data: Box<dyn Fn(Request, Params) -> Response>
)
Add a new route with TRACE
method.
Auto Trait Implementations
impl !RefUnwindSafe for Router
[src]
impl !Send for Router
[src]
impl !Sync for Router
[src]
impl Unpin for Router
[src]
impl !UnwindSafe for Router
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,