pub struct ConfigLoader { /* private fields */ }Expand description
Loads transfer manager Config from the environment.
Created by from_env. load resolves the S3
client configuration from the shared AWS configuration sources (environment
variables, shared config and credentials files, and the default credential and
region provider chains) unless s3_config supplies one. It
also detects the host’s EC2 instance type, vCPU count, and memory, which size
the automatic defaults. Settings not configured on the loader keep their
defaults.
Use Config::builder instead to construct a configuration from explicit
values without loading or instance-metadata detection.
use aws_s3_transfer::config::PartSize;
use aws_s3_transfer::types::ByteSize;
let config = aws_s3_transfer::from_env()
.part_size(PartSize::Target(ByteSize::mib(16)))
.load()
.await;
let client = aws_s3_transfer::Client::new(config);Implementations§
Source§impl ConfigLoader
impl ConfigLoader
Sourcepub fn multipart_threshold(self, threshold: PartSize) -> Self
pub fn multipart_threshold(self, threshold: PartSize) -> Self
Minimum object size that should trigger a multipart upload.
The minimum part size is 5 MiB, any part size less than that will be rounded up. Default is PartSize::Auto
Sourcepub fn part_size(self, part_size: PartSize) -> Self
pub fn part_size(self, part_size: PartSize) -> Self
The target size of each part when using a multipart upload to complete the request.
When a request’s content length is less than multipart_threshold,
this setting is ignored and a single PutObject request will be made instead.
NOTE: The actual part size used may be larger than the configured part size if the current value would result in more than 10,000 parts for an upload request.
Default is PartSize::Auto
Sourcepub fn concurrency(self, mode: ConcurrencyMode) -> Self
pub fn concurrency(self, mode: ConcurrencyMode) -> Self
Set the concurrency mode this client should use.
This sets the mode used for concurrent in-flight requests across all operations. Default is ConcurrencyMode::Auto.
Sourcepub fn runtime_config(self, config: RuntimeConfig) -> Self
pub fn runtime_config(self, config: RuntimeConfig) -> Self
Sets execution for transfer work.
Defaults to owned managed execution.
Sourcepub fn read_ahead(self, mode: ReadAhead) -> Self
pub fn read_ahead(self, mode: ReadAhead) -> Self
Set how far downloads may prefetch ahead of the consumer.
This is the client default for all downloads; a request may override it via
DownloadInput, or a running
transfer may adjust it via
DownloadIoCtl.
Default is ReadAhead::Auto.
Sourcepub fn memory(self, memory: MemoryConfig) -> Self
pub fn memory(self, memory: MemoryConfig) -> Self
Set the payload-memory configuration.
Default is MemoryConfig::Auto.
Sourcepub fn s3_config(self, config: impl Into<S3ClientConfig>) -> Self
pub fn s3_config(self, config: impl Into<S3ClientConfig>) -> Self
Use this S3 client configuration instead of loading shared AWS configuration.
When set, load reads no shared AWS configuration
sources; it still detects the machine profile.
Builder::s3_config describes how the transfer manager uses the
configuration.
let config = aws_s3_transfer::from_env()
.s3_config(&sdk_config)
.load()
.await;Sourcepub async fn load(self) -> Config
pub async fn load(self) -> Config
Load the configuration.
Without s3_config, the S3 client configuration is
loaded from the shared AWS configuration sources with the latest
behavior version. Machine detection always runs. Where local DMI can’t
identify the host, as on every non-Linux host and in containers without
DMI, load makes one EC2 instance metadata (IMDS) lookup: a single
attempt with 500 ms connect and read timeouts. Setting
AWS_EC2_METADATA_DISABLED to true, 1, yes or on
(case-insensitive) suppresses it.
Trait Implementations§
Source§impl Debug for ConfigLoader
impl Debug for ConfigLoader
Auto Trait Implementations§
impl !RefUnwindSafe for ConfigLoader
impl !UnwindSafe for ConfigLoader
impl Forget for ConfigLoader
impl Freeze for ConfigLoader
impl Move for ConfigLoader
impl Send for ConfigLoader
impl Sync for ConfigLoader
impl Unpin for ConfigLoader
impl UnsafeUnpin for ConfigLoader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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