pub struct ManagedMultipartBuilder { /* private fields */ }Expand description
Configures a bounded, retrying multipart upload from a local file.
Implementations§
Source§impl ManagedMultipartBuilder
impl ManagedMultipartBuilder
Sourcepub fn upload_options(self, options: ObjectUploadOptions) -> Self
pub fn upload_options(self, options: ObjectUploadOptions) -> Self
Sets typed metadata for a newly created multipart object.
Metadata cannot be changed while resuming an existing remote session.
Sourcepub fn content_type(self, value: Mime) -> Self
pub fn content_type(self, value: Mime) -> Self
Sets the completed object’s MIME media type.
Sourcepub fn cache_control(self, value: CacheControl) -> Self
pub fn cache_control(self, value: CacheControl) -> Self
Sets the completed object’s typed HTTP cache policy.
Sourcepub fn content_disposition(self, value: impl Into<String>) -> Self
pub fn content_disposition(self, value: impl Into<String>) -> Self
Sets the completed object’s content disposition.
Sourcepub fn content_encoding(self, value: impl Into<String>) -> Self
pub fn content_encoding(self, value: impl Into<String>) -> Self
Sets the completed object’s content encoding.
Sourcepub fn content_language(self, value: impl Into<String>) -> Self
pub fn content_language(self, value: impl Into<String>) -> Self
Sets the completed object’s content language.
Sourcepub fn expires(self, value: SystemTime) -> Self
pub fn expires(self, value: SystemTime) -> Self
Sets the completed object’s HTTP expiration time.
Sourcepub fn custom_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn custom_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Adds user-defined metadata to the completed object.
Sourcepub const fn part_size(self, bytes: u64) -> Self
pub const fn part_size(self, bytes: u64) -> Self
Sets the uniform non-final part size. Resumed sessions must keep their original size.
Sourcepub const fn part_size_mib(self, mebibytes: u64) -> Self
pub const fn part_size_mib(self, mebibytes: u64) -> Self
Sets the multipart part size in mebibytes (MiB).
This is equivalent to Self::part_size with a binary-unit conversion
and avoids repeating 1024 * 1024 at call sites. Unrepresentable or
out-of-range values are rejected before file or network I/O.
Sourcepub const fn concurrency(self, value: usize) -> Self
pub const fn concurrency(self, value: usize) -> Self
Sets the maximum number of in-flight parts, from 1 through 64.
Sourcepub const fn max_attempts(self, value: u8) -> Self
pub const fn max_attempts(self, value: u8) -> Self
Sets total attempts per part, including the first request, from 1 through 10.
Sourcepub const fn max_buffered_bytes(self, value: u64) -> Self
pub const fn max_buffered_bytes(self, value: u64) -> Self
Sets the maximum memory used by in-flight part buffers.
Validation uses the conservative upper bound part_size * concurrency
and runs before opening the source file or contacting R2. The default is
256 MiB.
Sourcepub const fn max_buffered_mib(self, mebibytes: u64) -> Self
pub const fn max_buffered_mib(self, mebibytes: u64) -> Self
Sets the maximum memory used by in-flight part buffers in MiB.
Sourcepub const fn abort_on_error(self, value: bool) -> Self
pub const fn abort_on_error(self, value: bool) -> Self
Chooses whether an error triggers a best-effort remote abort. The default is true.
Sourcepub fn on_progress(
self,
callback: impl Fn(ManagedUploadProgress) + Send + Sync + 'static,
) -> Self
pub fn on_progress( self, callback: impl Fn(ManagedUploadProgress) + Send + Sync + 'static, ) -> Self
Registers a fast, non-blocking callback invoked after progress changes.
Sourcepub fn cancellation_token(self, cancellation: ManagedUploadCancellation) -> Self
pub fn cancellation_token(self, cancellation: ManagedUploadCancellation) -> Self
Registers an explicit cooperative cancellation signal.
With the default abort_on_error(true), cancellation waits for a
best-effort remote abort before returning Error::Cancelled. If abort
fails, the returned error carries a snapshot for later cleanup or resume.
Sourcepub async fn upload_file(
self,
path: impl AsRef<Path>,
) -> Result<ManagedUploadResult, ManagedUploadError>
pub async fn upload_file( self, path: impl AsRef<Path>, ) -> Result<ManagedUploadResult, ManagedUploadError>
Uploads the local file, reusing validated remote parts when resuming.
Trait Implementations§
Source§impl Clone for ManagedMultipartBuilder
impl Clone for ManagedMultipartBuilder
Source§fn clone(&self) -> ManagedMultipartBuilder
fn clone(&self) -> ManagedMultipartBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ManagedMultipartBuilder
impl !UnwindSafe for ManagedMultipartBuilder
impl Freeze for ManagedMultipartBuilder
impl Send for ManagedMultipartBuilder
impl Sync for ManagedMultipartBuilder
impl Unpin for ManagedMultipartBuilder
impl UnsafeUnpin for ManagedMultipartBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more