Skip to content

Commit

Permalink
Remove unnecessary requirement for Sync for storage_objects_insert_ex…
Browse files Browse the repository at this point in the history
…t_stream extension function (#147)
  • Loading branch information
abdolence authored Jul 3, 2024
1 parent 7a447c1 commit be990be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub type BoxStreamWithSync<'a, T> = std::pin::Pin<Box<dyn futures::Stream<Item = T> + Send + 'a + Sync>>;
pub type BoxStreamWithSend<'a, T> = std::pin::Pin<Box<dyn futures::Stream<Item = T> + Send + 'a>>;

/// Stores a new object and metadata.
/// Open API doesn't support binary streams and this particular endpoint uses another base URL.
Expand All @@ -7,7 +8,7 @@ pub async fn storage_objects_insert_ext_stream(
configuration: &configuration::Configuration,
params: StoragePeriodObjectsPeriodInsertParams,
content_type: Option<String>,
bytes_stream: BoxStreamWithSync<
bytes_stream: BoxStreamWithSend<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
>
Expand Down Expand Up @@ -166,7 +167,7 @@ pub async fn storage_objects_insert_ext_bytes(
> {
use futures::StreamExt;

let bytes_stream: BoxStreamWithSync<
let bytes_stream: BoxStreamWithSend<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
> = Box::pin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,7 @@ pub async fn storage_objects_watch_all(

pub type BoxStreamWithSync<'a, T> =
std::pin::Pin<Box<dyn futures::Stream<Item = T> + Send + 'a + Sync>>;
pub type BoxStreamWithSend<'a, T> = std::pin::Pin<Box<dyn futures::Stream<Item = T> + Send + 'a>>;

/// Stores a new object and metadata.
/// Open API doesn't support binary streams and this particular endpoint uses another base URL.
Expand All @@ -2389,7 +2390,7 @@ pub async fn storage_objects_insert_ext_stream(
configuration: &configuration::Configuration,
params: StoragePeriodObjectsPeriodInsertParams,
content_type: Option<String>,
bytes_stream: BoxStreamWithSync<
bytes_stream: BoxStreamWithSend<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
>,
Expand Down Expand Up @@ -2546,7 +2547,7 @@ pub async fn storage_objects_insert_ext_bytes(
> {
use futures::StreamExt;

let bytes_stream: BoxStreamWithSync<
let bytes_stream: BoxStreamWithSend<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
> = Box::pin(
Expand Down

0 comments on commit be990be

Please sign in to comment.