update rust server samples

This commit is contained in:
William Cheng
2019-08-04 23:06:14 +08:00
parent 83f17941b9
commit 4df1e1928c
5 changed files with 6 additions and 530 deletions

View File

@@ -51,7 +51,7 @@ mod paths {
extern crate regex;
lazy_static! {
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[
pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![
r"^/multipart_request$"
]).unwrap();
}

View File

@@ -23,8 +23,8 @@ swagger = "2"
#
lazy_static = "0.2"
log = "0.3.0"
mime = "0.3.3"
multipart = {version = "0.13.3", optional = true}
mime = "0.2.6"
multipart = {version = "0.13.3"}
native-tls = {version = "0.1.4", optional = true}
openssl = {version = "0.9.14", optional = true}
percent-encoding = {version = "1.0.0", optional = true}

View File

@@ -7,8 +7,6 @@ extern crate mime;
extern crate chrono;
extern crate url;
use hyper;
use hyper::header::{Headers, ContentType};
use hyper::Uri;
@@ -26,12 +24,9 @@ use std::sync::Arc;
use std::str;
use std::str::FromStr;
use std::string::ToString;
use mimetypes;
use serde_json;
#[allow(unused_imports)]
use std::collections::{HashMap, BTreeMap};
#[allow(unused_imports)]
@@ -306,8 +301,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -369,8 +362,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -432,8 +423,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -495,8 +484,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -558,8 +545,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -621,8 +606,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -684,8 +667,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -747,8 +728,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -810,8 +789,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -873,8 +850,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -936,8 +911,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -999,8 +972,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1062,8 +1033,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1125,8 +1094,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1188,8 +1155,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1251,8 +1216,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1314,8 +1277,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1377,8 +1338,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1440,8 +1399,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1503,8 +1460,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1566,8 +1521,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1629,8 +1582,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1692,8 +1643,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1755,8 +1704,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1818,8 +1765,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1881,8 +1826,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -1944,8 +1887,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2007,8 +1948,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2070,8 +2009,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2133,8 +2070,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2196,8 +2131,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2259,8 +2192,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2322,8 +2253,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2385,8 +2314,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2448,8 +2375,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2511,8 +2436,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {
@@ -2574,8 +2497,6 @@ impl<F, C> Api<C> for Client<F> where
request.headers_mut().set(XSpanId((context as &Has<XSpanIdString>).get().0.clone()));
Box::new(self.client_service.call(request)
.map_err(|e| ApiError(format!("No response received: {}", e)))
.and_then(|mut response| {

View File

@@ -11,6 +11,7 @@ extern crate chrono;
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate mime;
// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module.
#[cfg(any(feature = "client", feature = "server"))]

View File

@@ -5,11 +5,10 @@ extern crate native_tls;
extern crate hyper_tls;
extern crate openssl;
extern crate mime;
extern crate uuid;
extern crate chrono;
extern crate percent_encoding;
extern crate url;
extern crate uuid;
use std::sync::Arc;
use std::marker::PhantomData;
@@ -19,10 +18,8 @@ use hyper::{Request, Response, Error, StatusCode};
use hyper::header::{Headers, ContentType};
use self::url::form_urlencoded;
use mimetypes;
use serde_json;
#[allow(unused_imports)]
use std::collections::{HashMap, BTreeMap};
#[allow(unused_imports)]
@@ -230,16 +227,8 @@ where
// Op10Get - GET /op10
&hyper::Method::Get if path.matched(paths::ID_OP10) => {
Box::new({
{{
Box::new(api_impl.op10_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -266,26 +255,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op11Get - GET /op11
&hyper::Method::Get if path.matched(paths::ID_OP11) => {
Box::new({
{{
Box::new(api_impl.op11_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -312,26 +289,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op12Get - GET /op12
&hyper::Method::Get if path.matched(paths::ID_OP12) => {
Box::new({
{{
Box::new(api_impl.op12_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -358,26 +323,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op13Get - GET /op13
&hyper::Method::Get if path.matched(paths::ID_OP13) => {
Box::new({
{{
Box::new(api_impl.op13_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -404,26 +357,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op14Get - GET /op14
&hyper::Method::Get if path.matched(paths::ID_OP14) => {
Box::new({
{{
Box::new(api_impl.op14_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -450,26 +391,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op15Get - GET /op15
&hyper::Method::Get if path.matched(paths::ID_OP15) => {
Box::new({
{{
Box::new(api_impl.op15_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -496,26 +425,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op16Get - GET /op16
&hyper::Method::Get if path.matched(paths::ID_OP16) => {
Box::new({
{{
Box::new(api_impl.op16_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -542,26 +459,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op17Get - GET /op17
&hyper::Method::Get if path.matched(paths::ID_OP17) => {
Box::new({
{{
Box::new(api_impl.op17_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -588,26 +493,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op18Get - GET /op18
&hyper::Method::Get if path.matched(paths::ID_OP18) => {
Box::new({
{{
Box::new(api_impl.op18_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -634,26 +527,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op19Get - GET /op19
&hyper::Method::Get if path.matched(paths::ID_OP19) => {
Box::new({
{{
Box::new(api_impl.op19_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -680,26 +561,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op1Get - GET /op1
&hyper::Method::Get if path.matched(paths::ID_OP1) => {
Box::new({
{{
Box::new(api_impl.op1_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -726,26 +595,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op20Get - GET /op20
&hyper::Method::Get if path.matched(paths::ID_OP20) => {
Box::new({
{{
Box::new(api_impl.op20_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -772,26 +629,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op21Get - GET /op21
&hyper::Method::Get if path.matched(paths::ID_OP21) => {
Box::new({
{{
Box::new(api_impl.op21_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -818,26 +663,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op22Get - GET /op22
&hyper::Method::Get if path.matched(paths::ID_OP22) => {
Box::new({
{{
Box::new(api_impl.op22_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -864,26 +697,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op23Get - GET /op23
&hyper::Method::Get if path.matched(paths::ID_OP23) => {
Box::new({
{{
Box::new(api_impl.op23_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -910,26 +731,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op24Get - GET /op24
&hyper::Method::Get if path.matched(paths::ID_OP24) => {
Box::new({
{{
Box::new(api_impl.op24_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -956,26 +765,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op25Get - GET /op25
&hyper::Method::Get if path.matched(paths::ID_OP25) => {
Box::new({
{{
Box::new(api_impl.op25_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1002,26 +799,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op26Get - GET /op26
&hyper::Method::Get if path.matched(paths::ID_OP26) => {
Box::new({
{{
Box::new(api_impl.op26_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1048,26 +833,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op27Get - GET /op27
&hyper::Method::Get if path.matched(paths::ID_OP27) => {
Box::new({
{{
Box::new(api_impl.op27_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1094,26 +867,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op28Get - GET /op28
&hyper::Method::Get if path.matched(paths::ID_OP28) => {
Box::new({
{{
Box::new(api_impl.op28_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1140,26 +901,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op29Get - GET /op29
&hyper::Method::Get if path.matched(paths::ID_OP29) => {
Box::new({
{{
Box::new(api_impl.op29_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1186,26 +935,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op2Get - GET /op2
&hyper::Method::Get if path.matched(paths::ID_OP2) => {
Box::new({
{{
Box::new(api_impl.op2_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1232,26 +969,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op30Get - GET /op30
&hyper::Method::Get if path.matched(paths::ID_OP30) => {
Box::new({
{{
Box::new(api_impl.op30_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1278,26 +1003,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op31Get - GET /op31
&hyper::Method::Get if path.matched(paths::ID_OP31) => {
Box::new({
{{
Box::new(api_impl.op31_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1324,26 +1037,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op32Get - GET /op32
&hyper::Method::Get if path.matched(paths::ID_OP32) => {
Box::new({
{{
Box::new(api_impl.op32_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1370,26 +1071,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op33Get - GET /op33
&hyper::Method::Get if path.matched(paths::ID_OP33) => {
Box::new({
{{
Box::new(api_impl.op33_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1416,26 +1105,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op34Get - GET /op34
&hyper::Method::Get if path.matched(paths::ID_OP34) => {
Box::new({
{{
Box::new(api_impl.op34_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1462,26 +1139,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op35Get - GET /op35
&hyper::Method::Get if path.matched(paths::ID_OP35) => {
Box::new({
{{
Box::new(api_impl.op35_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1508,26 +1173,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op36Get - GET /op36
&hyper::Method::Get if path.matched(paths::ID_OP36) => {
Box::new({
{{
Box::new(api_impl.op36_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1554,26 +1207,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op37Get - GET /op37
&hyper::Method::Get if path.matched(paths::ID_OP37) => {
Box::new({
{{
Box::new(api_impl.op37_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1600,26 +1241,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op3Get - GET /op3
&hyper::Method::Get if path.matched(paths::ID_OP3) => {
Box::new({
{{
Box::new(api_impl.op3_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1646,26 +1275,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op4Get - GET /op4
&hyper::Method::Get if path.matched(paths::ID_OP4) => {
Box::new({
{{
Box::new(api_impl.op4_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1692,26 +1309,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op5Get - GET /op5
&hyper::Method::Get if path.matched(paths::ID_OP5) => {
Box::new({
{{
Box::new(api_impl.op5_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1738,26 +1343,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op6Get - GET /op6
&hyper::Method::Get if path.matched(paths::ID_OP6) => {
Box::new({
{{
Box::new(api_impl.op6_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1784,26 +1377,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op7Get - GET /op7
&hyper::Method::Get if path.matched(paths::ID_OP7) => {
Box::new({
{{
Box::new(api_impl.op7_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1830,26 +1411,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op8Get - GET /op8
&hyper::Method::Get if path.matched(paths::ID_OP8) => {
Box::new({
{{
Box::new(api_impl.op8_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1876,26 +1445,14 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
// Op9Get - GET /op9
&hyper::Method::Get if path.matched(paths::ID_OP9) => {
Box::new({
{{
Box::new(api_impl.op9_get(&context)
.then(move |result| {
let mut response = Response::new();
@@ -1922,14 +1479,10 @@ where
future::ok(response)
}
))
}}
}) as Box<Future<Item=Response, Error=Error>>
},
_ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box<Future<Item=Response, Error=Error>>,
}
}
@@ -1945,6 +1498,7 @@ impl<T, C> Clone for Service<T, C>
}
}
/// Request parser for `Api`.
pub struct ApiRequestParser;
impl RequestParser for ApiRequestParser {