Skip to content

Commit

Permalink
docs: Polish the docs for writer
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Feb 29, 2024
1 parent c1927a0 commit 2dd8e77
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions core/src/types/operator/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,13 @@ impl Operator {
/// ## Streaming Write
///
/// This function will write all bytes at once. For more precise memory control or
/// writing data lazily, please use [`Operator::writer`].
/// writing data continuously, please use [`Operator::writer`].
///
/// ## Multipart Uploads Write
///
/// OpenDAL abstracts the multipart uploads into [`Writer`]. It will automatically
/// handle the multipart uploads for you. You can control the behavior of multipart uploads
/// by setting `buffer`, `concurrent` via [`Operator::writer_with`]
///
/// # Examples
///
Expand Down Expand Up @@ -867,6 +873,17 @@ impl Operator {
/// extra options like `content_type` and `cache_control`, please use [`Operator::write_with`]
/// instead.
///
/// ## Buffer
///
/// OpenDAL is designed to write files directly without buffering by default, giving users
/// control over the exact size of their writes and helping avoid unnecessary costs.
///
/// This is not efficient for cases when users write small chunks of data. Some storage services
/// like `s3` could even return hard errors like `EntityTooSmall`. Besides, cloud storage services
/// will cost more money if we write data in small chunks.
///
/// Users can use [`Operator::write_with`] to set a good buffer size might improve the performance,
///
/// # Examples
///
/// ```
Expand Down Expand Up @@ -923,12 +940,14 @@ impl Operator {
///
/// Set `buffer` for the writer.
///
/// OpenDAL by default to write file without buffer. This is not efficient for cases when users
/// write small chunks of data. Some storage services like `s3` could even return hard errors
/// like `EntityTooSmall`. To improve performance, we can set a buffer.
/// OpenDAL is designed to write files directly without buffering by default, giving users
/// control over the exact size of their writes and helping avoid unnecessary costs.
///
/// This is not efficient for cases when users write small chunks of data. Some storage services
/// like `s3` could even return hard errors like `EntityTooSmall`. Besides, cloud storage services
/// will cost more money if we write data in small chunks.
///
/// Besides, cloud storage services will cost more money if we write data in small chunks. Set
/// a good buffer size might reduce the API calls and save money.
/// Set a good buffer size might improve the performance, reduce the API calls and save money.
///
/// The following example will set the writer buffer to 8MiB. Only one API call will be sent at
/// `close` instead.
Expand Down Expand Up @@ -1114,6 +1133,12 @@ impl Operator {
/// This function will write all bytes at once. For more precise memory control or
/// writing data lazily, please use [`Operator::writer_with`].
///
/// ## Multipart Uploads Write
///
/// OpenDAL abstracts the multipart uploads into [`Writer`]. It will automatically
/// handle the multipart uploads for you. You can control the behavior of multipart uploads
/// by setting `buffer`, `concurrent` via [`Operator::writer_with`]
///
/// # Options
///
/// ## `append`
Expand Down

0 comments on commit 2dd8e77

Please sign in to comment.