pub struct PutObjectStreamRequest<'a> { /* private fields */ }Expand description
Builder for streaming PUT operations.
If an error is returned after multipart initiation, the upload is aborted on a best-effort basis. Cancelling the future cannot run an asynchronous abort, and in-flight parts or a lost completion response can leave remote state uncertain.
On multipart uploads, headers supplied to this builder are routed by request:
object metadata and other custom headers are sent at initiation, SSE-C headers
are repeated for initiation, parts, and completion, requester-pays and expected
bucket-owner headers are sent on each request, and If-Match/If-None-Match
are sent at completion. Content-MD5, checksum headers, Content-Length,
Transfer-Encoding, and x-amz-content-sha256 are rejected because one
builder value cannot describe the streamed part bodies. with_content_type
controls the generated content type for initiation and parts. Bucket-level
extra headers keep their existing raw behavior and must be valid for every
request made by the multipart upload.
Implementations§
Source§impl<'a> PutObjectStreamRequest<'a>
impl<'a> PutObjectStreamRequest<'a>
Sourcepub fn with_content_type<S: AsRef<str>>(self, content_type: S) -> Self
pub fn with_content_type<S: AsRef<str>>(self, content_type: S) -> Self
Set the Content-Type header
Sourcepub fn with_cache_control<S: AsRef<str>>(
self,
cache_control: S,
) -> Result<Self, S3Error>
pub fn with_cache_control<S: AsRef<str>>( self, cache_control: S, ) -> Result<Self, S3Error>
Set the Cache-Control header
Sourcepub fn with_content_encoding<S: AsRef<str>>(
self,
encoding: S,
) -> Result<Self, S3Error>
pub fn with_content_encoding<S: AsRef<str>>( self, encoding: S, ) -> Result<Self, S3Error>
Set the Content-Encoding header
Sourcepub fn with_header<K, V>(self, key: K, value: V) -> Result<Self, S3Error>
pub fn with_header<K, V>(self, key: K, value: V) -> Result<Self, S3Error>
Add a custom header
Sourcepub fn with_headers(self, headers: HeaderMap) -> Self
pub fn with_headers(self, headers: HeaderMap) -> Self
Add multiple custom headers (already validated HeaderMap)
Sourcepub fn with_metadata<K: AsRef<str>, V: AsRef<str>>(
self,
key: K,
value: V,
) -> Result<Self, S3Error>
pub fn with_metadata<K: AsRef<str>, V: AsRef<str>>( self, key: K, value: V, ) -> Result<Self, S3Error>
Add S3 metadata header (x-amz-meta-*)
Sourcepub fn with_max_concurrent_chunks(self, max: usize) -> Self
pub fn with_max_concurrent_chunks(self, max: usize) -> Self
Set the maximum number of multipart parts this upload may have in flight.
A value of 1 uploads parts sequentially through the same streaming
path. Values greater than 1 set the exact per-upload concurrency cap,
including values above the automatic default’s maximum of 10. A value
of 0 restores the automatic setting, currently 2–10 parts based on
available memory, or 3 if memory detection fails. This is a per-upload
concurrency limit, not a process-wide memory or RSS limit. It applies
only to multipart uploads; smaller objects use a regular PUT.
Sourcepub async fn execute_stream<R: AsyncRead + Unpin + ?Sized>(
self,
reader: &mut R,
) -> Result<PutStreamResponse, S3Error>
pub async fn execute_stream<R: AsyncRead + Unpin + ?Sized>( self, reader: &mut R, ) -> Result<PutStreamResponse, S3Error>
Execute the streaming PUT request