@@ -135,19 +135,7 @@ where
135135 }
136136 }
137137
138- /// Write an object using a local buffer.
139- ///
140- /// If the data source does **not** implement [Seek] the client library must
141- /// buffer data sent to the service until the service confirms it has
142- /// persisted the data. This requires more memory in the client, and when
143- /// the buffer grows too large, may require stalling the writer until the
144- /// service can persist the data.
145- ///
146- /// Use this function for data sources representing computations where
147- /// it is expensive or impossible to restart said computation. This function
148- /// is also useful when it is hard or impossible to predict the number of
149- /// bytes emitted by a stream, even if restarting the stream is not too
150- /// expensive.
138+ /// Write an object with data from any data source.
151139 ///
152140 /// # Example
153141 /// ```
@@ -173,13 +161,23 @@ where
173161 /// # Ok(()) }
174162 /// ```
175163 ///
164+ /// You can use many different types as the payload. For example, a string,
165+ /// a [bytes::Bytes], a [tokio::fs::File], or a custom type that implements
166+ /// the [StreamingSource] trait.
167+ ///
168+ /// If your data source also implements [Seek], prefer [send_unbuffered()]
169+ /// to start the write. Otherwise use [send_buffered()].
170+ ///
176171 /// # Parameters
177172 /// * `bucket` - the bucket name containing the object. In
178173 /// `projects/_/buckets/{bucket_id}` format.
179174 /// * `object` - the object name.
180175 /// * `payload` - the object data.
181176 ///
182177 /// [Seek]: crate::streaming_source::Seek
178+ /// [StreamingSource]: crate::streaming_source::StreamingSource
179+ /// [send_buffered()]: crate::builder::storage::WriteObject::send_buffered
180+ /// [send_unbuffered()]: crate::builder::storage::WriteObject::send_unbuffered
183181 pub fn write_object < B , O , T , P > ( & self , bucket : B , object : O , payload : T ) -> WriteObject < P , S >
184182 where
185183 B : Into < String > ,
0 commit comments