From 91ebea82623c832f40531aab3639d885cd170079 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 6 Mar 2019 10:18:06 +0100 Subject: [PATCH] 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 --- src/api_schema/router.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api_schema/router.rs b/src/api_schema/router.rs index 09651d59..02328a75 100644 --- a/src/api_schema/router.rs +++ b/src/api_schema/router.rs @@ -234,6 +234,10 @@ impl Router { self } + pub fn upgrade(mut self, m: ApiAsyncMethod) -> Self { + self.get = MethodDefinition::Async(m); + self + } pub fn delete(mut self, m: ApiMethod) -> Self { self.delete = MethodDefinition::Simple(m);