pub struct S3UploadConfig {
pub endpoint: String,
pub bucket: String,
pub access_key_id: String,
pub secret_access_key: String,
pub prefix: String,
pub region: Option<String>,
pub virtual_hosted_style: bool,
pub checksum_sha256: bool,
}Expand description
Resolved upload configuration for an S3-compatible destination.
Fields§
§endpoint: StringS3-compatible endpoint URL (e.g. https://s3.us-west-004.backblazeb2.com).
bucket: StringBucket name.
access_key_id: StringAccess key id.
secret_access_key: StringSecret access key.
prefix: StringKey prefix; joined with the snapshot file name by S3UploadConfig::key_for.
region: Option<String>Optional signing region (DEFAULT_REGION is used when absent).
virtual_hosted_style: boolAddressing style: true = virtual-hosted (bucket.endpoint/key),
false = path style (endpoint/bucket/key, default — required by
MinIO and accepted by AWS / B2 / R2).
checksum_sha256: boolWhen true, puts carry an x-amz-checksum-sha256 header (the only
algorithm object_store supports). Default false — some
S3-compatible providers reject checksum headers with
400 InvalidArgument: Unsupported header.
Implementations§
Source§impl S3UploadConfig
impl S3UploadConfig
Sourcepub fn from_vars(vars: &HashMap<String, String>) -> Result<Self, MiniAppError>
pub fn from_vars(vars: &HashMap<String, String>) -> Result<Self, MiniAppError>
Resolves the configuration from an arbitrary variable map.
Pure function over vars — no process-environment access — so unit
tests can exercise every branch without mutating std::env (which is
unsafe under parallel test execution).
Empty-string values are treated as missing.
§Errors
MiniAppError::UploadNotConfiguredlisting every missing required variable by name.
Sourcepub fn from_env() -> Result<Self, MiniAppError>
pub fn from_env() -> Result<Self, MiniAppError>
Resolves the configuration from the process environment.
§Errors
MiniAppError::UploadNotConfiguredwhen required variables are missing (seeS3UploadConfig::from_vars).
Trait Implementations§
Source§impl Clone for S3UploadConfig
impl Clone for S3UploadConfig
Source§fn clone(&self) -> S3UploadConfig
fn clone(&self) -> S3UploadConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more