Skip to main content

ManagedMultipartBuilder

Struct ManagedMultipartBuilder 

Source
pub struct ManagedMultipartBuilder { /* private fields */ }
Expand description

Configures a bounded, retrying multipart upload from a local file.

Implementations§

Source§

impl ManagedMultipartBuilder

Source

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.

Source

pub fn content_type(self, value: Mime) -> Self

Sets the completed object’s MIME media type.

Source

pub fn cache_control(self, value: CacheControl) -> Self

Sets the completed object’s typed HTTP cache policy.

Source

pub fn content_disposition(self, value: impl Into<String>) -> Self

Sets the completed object’s content disposition.

Source

pub fn content_encoding(self, value: impl Into<String>) -> Self

Sets the completed object’s content encoding.

Source

pub fn content_language(self, value: impl Into<String>) -> Self

Sets the completed object’s content language.

Source

pub fn expires(self, value: SystemTime) -> Self

Sets the completed object’s HTTP expiration time.

Source

pub fn custom_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Adds user-defined metadata to the completed object.

Source

pub const fn part_size(self, bytes: u64) -> Self

Sets the uniform non-final part size. Resumed sessions must keep their original size.

Source

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.

Source

pub const fn concurrency(self, value: usize) -> Self

Sets the maximum number of in-flight parts, from 1 through 64.

Source

pub const fn max_attempts(self, value: u8) -> Self

Sets total attempts per part, including the first request, from 1 through 10.

Source

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.

Source

pub const fn max_buffered_mib(self, mebibytes: u64) -> Self

Sets the maximum memory used by in-flight part buffers in MiB.

Source

pub const fn abort_on_error(self, value: bool) -> Self

Chooses whether an error triggers a best-effort remote abort. The default is true.

Source

pub fn on_progress( self, callback: impl Fn(ManagedUploadProgress) + Send + Sync + 'static, ) -> Self

Registers a fast, non-blocking callback invoked after progress changes.

Source

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.

Source

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

Source§

fn clone(&self) -> ManagedMultipartBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ManagedMultipartBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more