aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/examples/server_lib/server.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-07-25 23:40:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-07-25 23:40:28 -0700
commit10e59ac5d002c0b91dece34ed2a082ba5f022edd (patch)
tree25f8ccd3641060315eb65534dfb286edf5e36b59 /rust/fatcat-api/examples/server_lib/server.rs
parent5b8d98192972ccbc776024dc4041e4519557a03b (diff)
downloadfatcat-10e59ac5d002c0b91dece34ed2a082ba5f022edd.tar.gz
fatcat-10e59ac5d002c0b91dece34ed2a082ba5f022edd.zip
API schema: identifier checking, expand query param
Diffstat (limited to 'rust/fatcat-api/examples/server_lib/server.rs')
-rw-r--r--rust/fatcat-api/examples/server_lib/server.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/rust/fatcat-api/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs
index a25e175f..bd18d8fb 100644
--- a/rust/fatcat-api/examples/server_lib/server.rs
+++ b/rust/fatcat-api/examples/server_lib/server.rs
@@ -110,9 +110,9 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn get_container(&self, id: String, context: &Context) -> Box<Future<Item = GetContainerResponse, Error = ApiError> + Send> {
+ fn get_container(&self, id: String, expend: Option<String>, context: &Context) -> Box<Future<Item = GetContainerResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("get_container(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!("get_container(\"{}\", {:?}) - X-Span-ID: {:?}", id, expend, context.x_span_id.unwrap_or(String::from("<none>")).clone());
Box::new(futures::failed("Generic failure".into()))
}
@@ -127,9 +127,9 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn get_creator(&self, id: String, context: &Context) -> Box<Future<Item = GetCreatorResponse, Error = ApiError> + Send> {
+ fn get_creator(&self, id: String, expend: Option<String>, context: &Context) -> Box<Future<Item = GetCreatorResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("get_creator(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!("get_creator(\"{}\", {:?}) - X-Span-ID: {:?}", id, expend, context.x_span_id.unwrap_or(String::from("<none>")).clone());
Box::new(futures::failed("Generic failure".into()))
}
@@ -168,9 +168,9 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn get_file(&self, id: String, context: &Context) -> Box<Future<Item = GetFileResponse, Error = ApiError> + Send> {
+ fn get_file(&self, id: String, expend: Option<String>, context: &Context) -> Box<Future<Item = GetFileResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("get_file(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!("get_file(\"{}\", {:?}) - X-Span-ID: {:?}", id, expend, context.x_span_id.unwrap_or(String::from("<none>")).clone());
Box::new(futures::failed("Generic failure".into()))
}
@@ -185,9 +185,9 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn get_release(&self, id: String, context: &Context) -> Box<Future<Item = GetReleaseResponse, Error = ApiError> + Send> {
+ fn get_release(&self, id: String, expend: Option<String>, context: &Context) -> Box<Future<Item = GetReleaseResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("get_release(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!("get_release(\"{}\", {:?}) - X-Span-ID: {:?}", id, expend, context.x_span_id.unwrap_or(String::from("<none>")).clone());
Box::new(futures::failed("Generic failure".into()))
}
@@ -214,9 +214,9 @@ impl Api for Server {
Box::new(futures::failed("Generic failure".into()))
}
- fn get_work(&self, id: String, context: &Context) -> Box<Future<Item = GetWorkResponse, Error = ApiError> + Send> {
+ fn get_work(&self, id: String, expend: Option<String>, context: &Context) -> Box<Future<Item = GetWorkResponse, Error = ApiError> + Send> {
let context = context.clone();
- println!("get_work(\"{}\") - X-Span-ID: {:?}", id, context.x_span_id.unwrap_or(String::from("<none>")).clone());
+ println!("get_work(\"{}\", {:?}) - X-Span-ID: {:?}", id, expend, context.x_span_id.unwrap_or(String::from("<none>")).clone());
Box::new(futures::failed("Generic failure".into()))
}