router: add upgrade method

This is just an Async GET method, but semantically
different, so it gets its own router method.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-03-06 10:18:06 +01:00
parent 80822b95b1
commit 91ebea8262

View File

@ -234,6 +234,10 @@ impl Router {
self self
} }
pub fn upgrade(mut self, m: ApiAsyncMethod) -> Self {
self.get = MethodDefinition::Async(m);
self
}
pub fn delete(mut self, m: ApiMethod) -> Self { pub fn delete(mut self, m: ApiMethod) -> Self {
self.delete = MethodDefinition::Simple(m); self.delete = MethodDefinition::Simple(m);