@@ -222,6 +222,7 @@ pub struct BufWriter {
222
222
max_concurrency : usize ,
223
223
attributes : Option < Attributes > ,
224
224
tags : Option < TagSet > ,
225
+ extensions : Option < :: http:: Extensions > ,
225
226
state : BufWriterState ,
226
227
store : Arc < dyn ObjectStore > ,
227
228
}
@@ -259,6 +260,7 @@ impl BufWriter {
259
260
max_concurrency : 8 ,
260
261
attributes : None ,
261
262
tags : None ,
263
+ extensions : None ,
262
264
state : BufWriterState :: Buffer ( path, PutPayloadMut :: new ( ) ) ,
263
265
}
264
266
}
@@ -289,6 +291,19 @@ impl BufWriter {
289
291
}
290
292
}
291
293
294
+ /// Set the extensions of the uploaded object
295
+ ///
296
+ /// Implementation-specific extensions. Intended for use by [`ObjectStore`] implementations
297
+ /// that need to pass context-specific information (like tracing spans) via trait methods.
298
+ ///
299
+ /// These extensions are ignored entirely by backends offered through this crate.
300
+ pub fn with_extensions ( self , extensions : :: http:: Extensions ) -> Self {
301
+ Self {
302
+ extensions : Some ( extensions) ,
303
+ ..self
304
+ }
305
+ }
306
+
292
307
/// Write data to the writer in [`Bytes`].
293
308
///
294
309
/// Unlike [`AsyncWrite::poll_write`], `put` can write data without extra copying.
@@ -325,6 +340,7 @@ impl BufWriter {
325
340
let opts = PutMultipartOpts {
326
341
attributes : self . attributes . take ( ) . unwrap_or_default ( ) ,
327
342
tags : self . tags . take ( ) . unwrap_or_default ( ) ,
343
+ extensions : self . extensions . take ( ) . unwrap_or_default ( ) ,
328
344
} ;
329
345
let upload = self . store . put_multipart_opts ( & path, opts) . await ?;
330
346
let mut chunked =
@@ -384,6 +400,7 @@ impl AsyncWrite for BufWriter {
384
400
let opts = PutMultipartOpts {
385
401
attributes : self . attributes . take ( ) . unwrap_or_default ( ) ,
386
402
tags : self . tags . take ( ) . unwrap_or_default ( ) ,
403
+ extensions : self . extensions . take ( ) . unwrap_or_default ( ) ,
387
404
} ;
388
405
let store = Arc :: clone ( & self . store ) ;
389
406
self . state = BufWriterState :: Prepare ( Box :: pin ( async move {
0 commit comments