Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: relax a bunch of Sync requirements where unnecessary #140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
30 changes: 15 additions & 15 deletions ipfs-api-prelude/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub trait IpfsApi: Backend {
///
async fn add<R>(&self, data: R) -> Result<response::AddResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
self.add_with_options(data, request::Add::default()).await
}
Expand All @@ -78,7 +78,7 @@ pub trait IpfsApi: Backend {
///
async fn add_async<R>(&self, data: R) -> Result<response::AddResponse, Self::Error>
where
R: 'static + AsyncRead + Send + Sync + Unpin,
R: 'static + AsyncRead + Send + Unpin,
{
self.add_async_with_options(data, request::Add::default())
.await
Expand Down Expand Up @@ -116,7 +116,7 @@ pub trait IpfsApi: Backend {
add: request::Add<'_>,
) -> Result<response::AddResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -156,7 +156,7 @@ pub trait IpfsApi: Backend {
add: request::Add<'_>,
) -> Result<response::AddResponse, Self::Error>
where
R: 'static + AsyncRead + Send + Sync + Unpin,
R: 'static + AsyncRead + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -392,7 +392,7 @@ pub trait IpfsApi: Backend {
///
async fn block_put<R>(&self, data: R) -> Result<response::BlockPutResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
self.block_put_with_options(data, request::BlockPut::default())
.await
Expand All @@ -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()
Expand All @@ -428,7 +428,7 @@ pub trait IpfsApi: Backend {
options: request::BlockPut<'async_trait>,
) -> Result<response::BlockPutResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -757,7 +757,7 @@ pub trait IpfsApi: Backend {
data: R,
) -> Result<response::ConfigReplaceResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -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())
Expand All @@ -841,7 +841,7 @@ pub trait IpfsApi: Backend {
///
async fn dag_put<R>(&self, data: R) -> Result<response::DagPutResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
self.dag_put_with_options(data, request::DagPut::default())
.await
Expand Down Expand Up @@ -869,7 +869,7 @@ pub trait IpfsApi: Backend {
options: request::DagPut<'a>,
) -> Result<response::DagPutResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -1405,7 +1405,7 @@ pub trait IpfsApi: Backend {
data: R,
) -> Result<response::FilesWriteResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let options = request::FilesWrite {
path,
Expand Down Expand Up @@ -1452,7 +1452,7 @@ pub trait IpfsApi: Backend {
data: R,
) -> Result<response::FilesWriteResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -2161,7 +2161,7 @@ pub trait IpfsApi: Backend {
) -> Result<response::PubsubPubResponse, Self::Error>
where
T: AsRef<[u8]> + Send + Sync,
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down Expand Up @@ -2340,7 +2340,7 @@ pub trait IpfsApi: Backend {
///
async fn tar_add<R>(&self, data: R) -> Result<response::TarAddResponse, Self::Error>
where
R: 'static + Read + Send + Sync + Unpin,
R: 'static + Read + Send + Unpin,
{
let mut form = multipart::Form::default();

Expand Down