273273//!
274274//! # Multipart Upload
275275//!
276- //! Use the [`ObjectStore::put_multipart`] method to atomically write a large amount of data
276+ //! Use the [`ObjectStoreExt::put_multipart`] / [`ObjectStore::put_multipart_opts`] method to atomically write a large
277+ //! amount of data
277278//!
278279//! ```ignore-wasm32
279280//! # use object_store::local::LocalFileSystem;
280- //! # use object_store::{ObjectStore, WriteMultipart};
281+ //! # use object_store::{ObjectStore, ObjectStoreExt, WriteMultipart};
281282//! # use std::sync::Arc;
282283//! # use bytes::Bytes;
283284//! # use tokio::io::AsyncWriteExt;
@@ -638,17 +639,6 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
638639 opts : PutOptions ,
639640 ) -> Result < PutResult > ;
640641
641- /// Perform a multipart upload
642- ///
643- /// Client should prefer [`ObjectStoreExt::put`] for small payloads, as streaming uploads
644- /// typically require multiple separate requests. See [`MultipartUpload`] for more information
645- ///
646- /// For more advanced multipart uploads see [`MultipartStore`](multipart::MultipartStore)
647- async fn put_multipart ( & self , location : & Path ) -> Result < Box < dyn MultipartUpload > > {
648- self . put_multipart_opts ( location, PutMultipartOptions :: default ( ) )
649- . await
650- }
651-
652642 /// Perform a multipart upload with options
653643 ///
654644 /// Client should prefer [`ObjectStore::put_opts`] for small payloads, as streaming uploads
@@ -1117,10 +1107,6 @@ macro_rules! as_ref_impl {
11171107 self . as_ref( ) . put_opts( location, payload, opts) . await
11181108 }
11191109
1120- async fn put_multipart( & self , location: & Path ) -> Result <Box <dyn MultipartUpload >> {
1121- self . as_ref( ) . put_multipart( location) . await
1122- }
1123-
11241110 async fn put_multipart_opts(
11251111 & self ,
11261112 location: & Path ,
@@ -1202,7 +1188,7 @@ macro_rules! as_ref_impl {
12021188as_ref_impl ! ( Arc <dyn ObjectStore >) ;
12031189as_ref_impl ! ( Box <dyn ObjectStore >) ;
12041190
1205- /// Extension trait for [`ObjectStore`] with convinience functions.
1191+ /// Extension trait for [`ObjectStore`] with convenience functions.
12061192///
12071193/// See "contract" section within the [`ObjectStore`] documentation for more reasoning.
12081194///
@@ -1215,6 +1201,17 @@ pub trait ObjectStoreExt: ObjectStore {
12151201 /// write the entirety of `payload` to `location`, or fail. No clients
12161202 /// should be able to observe a partially written object
12171203 fn put ( & self , location : & Path , payload : PutPayload ) -> impl Future < Output = Result < PutResult > > ;
1204+
1205+ /// Perform a multipart upload
1206+ ///
1207+ /// Client should prefer [`ObjectStoreExt::put`] for small payloads, as streaming uploads
1208+ /// typically require multiple separate requests. See [`MultipartUpload`] for more information
1209+ ///
1210+ /// For more advanced multipart uploads see [`MultipartStore`](multipart::MultipartStore)
1211+ fn put_multipart (
1212+ & self ,
1213+ location : & Path ,
1214+ ) -> impl Future < Output = Result < Box < dyn MultipartUpload > > > ;
12181215}
12191216
12201217impl < T > ObjectStoreExt for T
@@ -1225,6 +1222,11 @@ where
12251222 self . put_opts ( location, payload, PutOptions :: default ( ) )
12261223 . await
12271224 }
1225+
1226+ async fn put_multipart ( & self , location : & Path ) -> Result < Box < dyn MultipartUpload > > {
1227+ self . put_multipart_opts ( location, PutMultipartOptions :: default ( ) )
1228+ . await
1229+ }
12281230}
12291231
12301232/// Result of a list call that includes objects, prefixes (directories) and a
0 commit comments