Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Polish the docs for writer #4296

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading