Router: implement missing builder methods

This commit is contained in:
Dietmar Maurer 2018-11-16 08:24:10 +01:00
parent fc937099b3
commit 2ab1f7119c
1 changed files with 15 additions and 0 deletions

View File

@ -51,6 +51,21 @@ impl Router {
self.get = Some(m); self.get = Some(m);
self 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> { pub fn find_route(&self, components: &[&str]) -> Option<&Router> {