[Rust Server] Fix #5906 (yaml with path parameter error) (#5871)

* [Rust Server] Fix Rust 1.39+ "Box<Future" and "as &Has" compile issue

* [Rust Server] Fix Rust server side pathRegEx and baseName not match issue

* [Rust Server] Add test case yaml with path parameter.
This commit is contained in:
Andy.Yang.cn
2020-04-16 00:19:00 +08:00
committed by GitHub
parent 95105cef2e
commit c3837ca331
27 changed files with 492 additions and 246 deletions

View File

@@ -48,7 +48,7 @@ fn main() {
.arg(Arg::with_name("port")
.long("port")
.takes_value(true)
.default_value("80")
.default_value("8080")
.help("Port to contact"))
.get_matches();
@@ -82,7 +82,7 @@ fn main() {
let result = rt.block_on(client.op_get(
???
));
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has<XSpanIdString>).get().clone());
info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has<XSpanIdString>).get().clone());
},
*/
_ => {

View File

@@ -42,7 +42,7 @@ fn main() {
.help("Whether to use HTTPS or not"))
.get_matches();
let addr = "127.0.0.1:80";
let addr = "127.0.0.1:8080";
hyper::rt::run(server::create(addr, matches.is_present("https")));
}

View File

@@ -113,7 +113,7 @@ impl<C> Api<C> for Server<C> where C: Has<XSpanIdString>{
fn op_get(
&self,
inline_object: models::InlineObject,
context: &C) -> Box<Future<Item=OpGetResponse, Error=ApiError> + Send>
context: &C) -> Box<dyn Future<Item=OpGetResponse, Error=ApiError> + Send>
{
let context = context.clone();
info!("op_get({:?}) - X-Span-ID: {:?}", inline_object, context.get().0.clone());