Commit f41c2a4 1 parent 7e5f523 commit f41c2a4 Copy full SHA for f41c2a4
File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,10 @@ impl AsyncBufRead for BufReader {
207
207
208
208
/// An async buffered writer compatible with the tokio IO traits
209
209
///
210
+ /// This writer adaptively uses [`ObjectStore::put`] or
211
+ /// [`ObjectStore::put_multipart`] depending on the amount of data that has
212
+ /// been written.
213
+ ///
210
214
/// Up to `capacity` bytes will be buffered in memory, and flushed on shutdown
211
215
/// using [`ObjectStore::put`]. If `capacity` is exceeded, data will instead be
212
216
/// streamed using [`ObjectStore::put_multipart`]
@@ -255,7 +259,8 @@ impl BufWriter {
255
259
}
256
260
}
257
261
258
- /// Returns the [`MultipartId`] if multipart upload
262
+ /// Returns the [`MultipartId`] of the multipart upload created by this
263
+ /// writer, if any.
259
264
pub fn multipart_id ( & self ) -> Option < & MultipartId > {
260
265
self . multipart_id . as_ref ( )
261
266
}
Original file line number Diff line number Diff line change 88
88
//!
89
89
//! # Why not a Filesystem Interface?
90
90
//!
91
- //! Whilst this crate does provide a [`BufReader`], the [` ObjectStore`] interface mirrors the APIs
92
- //! of object stores and not filesystems, opting to provide stateless APIs instead of the cursor
93
- //! based interfaces such as [`Read`] or [`Seek`] favoured by filesystems.
91
+ //! The [` ObjectStore`] interface is designed to mirror the APIs
92
+ //! of object stores and * not* filesystems, and thus has stateless APIs instead
93
+ //! of cursor based interfaces such as [`Read`] or [`Seek`] available in filesystems.
94
94
//!
95
- //! This provides some compelling advantages:
95
+ //! This design provides the following advantages:
96
96
//!
97
97
//! * All operations are atomic, and readers cannot observe partial and/or failed writes
98
98
//! * Methods map directly to object store APIs, providing both efficiency and predictability
99
99
//! * Abstracts away filesystem and operating system specific quirks, ensuring portability
100
100
//! * Allows for functionality not native to filesystems, such as operation preconditions
101
101
//! and atomic multipart uploads
102
102
//!
103
+ //! This crate does provide [`BufReader`] and [`BufWriter`] adapters
104
+ //! which provide a more filesystem-like API for working with the
105
+ //! [`ObjectStore`] trait, however, they should be used with care
106
+ //!
103
107
//! [`BufReader`]: buffered::BufReader
108
+ //! [`BufWriter`]: buffered::BufWriter
104
109
//!
105
110
//! # Adapters
106
111
//!
You can’t perform that action at this time.
0 commit comments