pub struct PartSize(/* private fields */);Expand description
Represents a valid part size for S3 multipart uploads.
PartSize ensures that the size of each part used in multipart uploads is within
the allowed range defined by S3. The size must be at least 5 MB and at most 5 GB.
§Constants
MIN_PART_SIZE: The minimum allowed part size (5 MB).MAX_PART_SIZE: The maximum allowed part size (5 GB).
Trait Implementations§
Source§impl Default for PartSize
The default size of a block for S3 multipart copy operations, set to 50 MiB.
impl Default for PartSize
The default size of a block for S3 multipart copy operations, set to 50 MiB.
§Why 50 MiB?
- Balance: Optimizes between throughput and the number of API calls.
- S3 Limits: Fits within S3’s part size requirements (min 5 MiB, max 5 TB).
- Parallelism: Allows efficient parallel uploads, speeding up the copy process.
- Error Handling: Facilitates easier retries of failed parts without re-uploading the entire object.
This size ensures efficient, cost-effective, and reliable multipart copy operations.
§Note
While 50 MiB is a good default for many use cases, it might not be suitable for all operations. Adjust the part size based on your specific requirements and constraints.
Source§impl<'__derive_more_into> From<&'__derive_more_into mut PartSize> for &'__derive_more_into mut i64
impl<'__derive_more_into> From<&'__derive_more_into mut PartSize> for &'__derive_more_into mut i64
Source§impl TryFrom<i64> for PartSize
Attempts to create a PartSize from an i64 value.
impl TryFrom<i64> for PartSize
Attempts to create a PartSize from an i64 value.
The TryFrom<i64> implementation for PartSize ensures that the given value is within
the allowed range for S3 multipart upload part sizes. If the value is within the range,
it returns Ok(PartSize). Otherwise, it returns an appropriate PartSizeError.
§Errors
- Returns
PartSizeError::TooSmallif the value is smaller thanMIN_PART_SIZE. - Returns
PartSizeError::TooLargeif the value is larger thanMAX_PART_SIZE.
Auto Trait Implementations§
impl Freeze for PartSize
impl RefUnwindSafe for PartSize
impl Send for PartSize
impl Sync for PartSize
impl Unpin for PartSize
impl UnwindSafe for PartSize
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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