From f125fdbde329095419630e02ebf33d2c73aeced7 Mon Sep 17 00:00:00 2001 From: Sameer Puri Date: Fri, 8 Feb 2019 17:57:34 -0600 Subject: Impose 'static on multipart forms --- ipfs-api/Cargo.toml | 2 +- ipfs-api/src/client.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ipfs-api/Cargo.toml b/ipfs-api/Cargo.toml index 871bb71..f3fb604 100644 --- a/ipfs-api/Cargo.toml +++ b/ipfs-api/Cargo.toml @@ -19,7 +19,7 @@ failure = "0.1.2" futures = "0.1" http = "0.1" hyper = "0.12" -hyper-multipart-rfc7578 = "0.2.0-alpha2" +hyper-multipart-rfc7578 = "0.3.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/ipfs-api/src/client.rs b/ipfs-api/src/client.rs index 1db5b4b..0c3277b 100644 --- a/ipfs-api/src/client.rs +++ b/ipfs-api/src/client.rs @@ -116,7 +116,7 @@ impl IpfsClient { fn build_base_request( &self, req: &Req, - form: Option, + form: Option>, ) -> Result, Error> where Req: ApiRequest + Serialize, @@ -133,7 +133,7 @@ impl IpfsClient { let mut builder = builder.method(Req::METHOD.clone()).uri(url); let req = if let Some(form) = form { - form.set_body(&mut builder) + form.set_body_convert::(&mut builder) } else { builder.body(hyper::Body::empty()) }; @@ -189,7 +189,7 @@ impl IpfsClient { fn request_raw( &self, req: &Req, - form: Option, + form: Option>, ) -> AsyncResponse<(StatusCode, Chunk)> where Req: ApiRequest + Serialize, @@ -218,7 +218,7 @@ impl IpfsClient { fn request_stream( &self, req: &Req, - form: Option, + form: Option>, process: F, ) -> AsyncStreamResponse where @@ -262,7 +262,7 @@ impl IpfsClient { /// Generic method for making a request to the Ipfs server, and getting /// a deserializable response. /// - fn request(&self, req: &Req, form: Option) -> AsyncResponse + fn request(&self, req: &Req, form: Option>) -> AsyncResponse where Req: ApiRequest + Serialize, for<'de> Res: 'static + Deserialize<'de> + Send, @@ -277,7 +277,7 @@ impl IpfsClient { /// Generic method for making a request to the Ipfs server, and getting /// back a response with no body. /// - fn request_empty(&self, req: &Req, form: Option) -> AsyncResponse<()> + fn request_empty(&self, req: &Req, form: Option>) -> AsyncResponse<()> where Req: ApiRequest + Serialize, { @@ -294,7 +294,7 @@ impl IpfsClient { /// Generic method for making a request to the Ipfs server, and getting /// back a raw String response. /// - fn request_string(&self, req: &Req, form: Option) -> AsyncResponse + fn request_string(&self, req: &Req, form: Option>) -> AsyncResponse where Req: ApiRequest + Serialize, { @@ -314,7 +314,7 @@ impl IpfsClient { fn request_stream_bytes( &self, req: &Req, - form: Option, + form: Option>, ) -> AsyncStreamResponse where Req: ApiRequest + Serialize, @@ -328,7 +328,7 @@ impl IpfsClient { fn request_stream_json( &self, req: &Req, - form: Option, + form: Option>, ) -> AsyncStreamResponse where Req: ApiRequest + Serialize, -- cgit v1.2.3