From ca2988c837181918eb2dd020a9ea543c65bd8272 Mon Sep 17 00:00:00 2001 From: Miraculous Owonubi Date: Sat, 16 Dec 2023 00:20:52 +0300 Subject: [PATCH 1/2] relax a bunch of Sync requirements where unnecessary --- ipfs-api-prelude/src/api.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ipfs-api-prelude/src/api.rs b/ipfs-api-prelude/src/api.rs index d82ee27..2640256 100644 --- a/ipfs-api-prelude/src/api.rs +++ b/ipfs-api-prelude/src/api.rs @@ -58,7 +58,7 @@ pub trait IpfsApi: Backend { /// async fn add(&self, data: R) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { self.add_with_options(data, request::Add::default()).await } @@ -78,7 +78,7 @@ pub trait IpfsApi: Backend { /// async fn add_async(&self, data: R) -> Result where - R: 'static + AsyncRead + Send + Sync + Unpin, + R: 'static + AsyncRead + Send + Unpin, { self.add_async_with_options(data, request::Add::default()) .await @@ -116,7 +116,7 @@ pub trait IpfsApi: Backend { add: request::Add<'_>, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -156,7 +156,7 @@ pub trait IpfsApi: Backend { add: request::Add<'_>, ) -> Result where - R: 'static + AsyncRead + Send + Sync + Unpin, + R: 'static + AsyncRead + Send + Unpin, { let mut form = multipart::Form::default(); @@ -392,7 +392,7 @@ pub trait IpfsApi: Backend { /// async fn block_put(&self, data: R) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { self.block_put_with_options(data, request::BlockPut::default()) .await @@ -412,7 +412,7 @@ pub trait IpfsApi: Backend { /// .mhlen(48) /// .build(); /// #[cfg(not(feature = "with-builder"))] - /// let options = ipts_api::request::BlockPut { + /// let options = ipfs_api::request::BlockPut { /// mhtype: "sha3_384", /// mhlen: 48, /// ..Default::default() @@ -428,7 +428,7 @@ pub trait IpfsApi: Backend { options: request::BlockPut<'async_trait>, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -757,7 +757,7 @@ pub trait IpfsApi: Backend { data: R, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -815,7 +815,7 @@ pub trait IpfsApi: Backend { /// #[cfg(not(feature = "with-builder"))] /// let options = DagGet { /// path: hash, - /// codec: DagCodec::Cbor, + /// codec: Some(DagCodec::Cbor), /// }; /// client.dag_get_with_options(options) /// .map_ok(|chunk| chunk.to_vec()) @@ -841,7 +841,7 @@ pub trait IpfsApi: Backend { /// async fn dag_put(&self, data: R) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { self.dag_put_with_options(data, request::DagPut::default()) .await @@ -869,7 +869,7 @@ pub trait IpfsApi: Backend { options: request::DagPut<'a>, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -1405,7 +1405,7 @@ pub trait IpfsApi: Backend { data: R, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let options = request::FilesWrite { path, @@ -1452,7 +1452,7 @@ pub trait IpfsApi: Backend { data: R, ) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -2161,7 +2161,7 @@ pub trait IpfsApi: Backend { ) -> Result where T: AsRef<[u8]> + Send + Sync, - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); @@ -2340,7 +2340,7 @@ pub trait IpfsApi: Backend { /// async fn tar_add(&self, data: R) -> Result where - R: 'static + Read + Send + Sync + Unpin, + R: 'static + Read + Send + Unpin, { let mut form = multipart::Form::default(); From 349e8408ebb8dcc8e674adae2ff0e438545d9806 Mon Sep 17 00:00:00 2001 From: Miraculous Owonubi Date: Sat, 16 Dec 2023 00:28:18 +0300 Subject: [PATCH 2/2] add temp dep patches for multipart crate --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index e296c63..b9cb6c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,8 @@ members = [ "ipfs-api-prelude", "ipfs-api-versions", ] + +[patch.crates-io] +common-multipart-rfc7578 = { git = "https://github.com/miraclx/rust-multipart-rfc7578", branch = "relax-sync-requirement" } +hyper-multipart-rfc7578 = { git = "https://github.com/miraclx/rust-multipart-rfc7578", branch = "relax-sync-requirement" } +actix-multipart-rfc7578 = { git = "https://github.com/miraclx/rust-multipart-rfc7578", branch = "relax-sync-requirement" }