Router: implement missing builder methods
This commit is contained in:
parent
fc937099b3
commit
2ab1f7119c
|
@ -52,6 +52,21 @@ impl Router {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn put(mut self, m: ApiMethod) -> Self {
|
||||
self.put = Some(m);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn post(mut self, m: ApiMethod) -> Self {
|
||||
self.post = Some(m);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn delete(mut self, m: ApiMethod) -> Self {
|
||||
self.delete = Some(m);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn find_route(&self, components: &[&str]) -> Option<&Router> {
|
||||
|
||||
if components.len() == 0 { return Some(self); };
|
||||
|
|
Loading…
Reference in New Issue