Skip to content

Commit

Permalink
Add MultipartUpload blanket implementation for Box<W> (#5919)
Browse files Browse the repository at this point in the history
* add impl for box

* update

* another update

* small fix
  • Loading branch information
fsdvh authored Jun 23, 2024
1 parent 02fb714 commit 0ea074a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions object_store/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ pub trait MultipartUpload: Send + std::fmt::Debug {
async fn abort(&mut self) -> Result<()>;
}

#[async_trait]
impl<W: MultipartUpload + ?Sized> MultipartUpload for Box<W> {
fn put_part(&mut self, data: PutPayload) -> UploadPart {
(**self).put_part(data)
}

async fn complete(&mut self) -> Result<PutResult> {
(**self).complete().await
}

async fn abort(&mut self) -> Result<()> {
(**self).abort().await
}
}

/// A synchronous write API for uploading data in parallel in fixed size chunks
///
/// Uses multiple tokio tasks in a [`JoinSet`] to multiplex upload tasks in parallel
Expand Down

0 comments on commit 0ea074a

Please sign in to comment.