pub struct S3OriginConfig {
pub bucket: String,
pub region: String,
pub endpoint_url: Option<String>,
pub path_style: Option<bool>,
pub prefix: Option<String>,
pub credentials: Option<S3Credentials>,
pub decompress: Option<DecompressMode>,
}Expand description
S3-compatible origin configuration (#437) — wire form.
Validation runs at config-resolution time via the (private)
resolve_s3_origin helper, which produces the runtime form
super::resolved::ResolvedS3Config. Unvalidated instances of
this type cannot reach the cache wiring layer because
super::resolved::ResolvedOrigin::S3 holds the resolved form,
not this one.
Fields§
§bucket: StringBucket name. Validated DNS-safe at config resolution
(lowercase [a-z0-9.-], 3–63 chars; see
validate_s3_bucket_name).
region: StringAWS region (e.g. "us-east-1"). Required because the S3 SDK
uses it for SigV4 signing even when a custom endpoint_url
is set. Validated non-empty at config resolution.
endpoint_url: Option<String>Custom endpoint URL for non-AWS S3-compatible providers (R2,
B2, MinIO). Omit for AWS S3. Validated as http/https at
config resolution.
path_style: Option<bool>Use path-style addressing (https://endpoint/bucket/key)
instead of virtual-hosted-style (https://bucket.endpoint/key).
Required true for MinIO and many self-hosted providers;
AWS S3 and Cloudflare R2 use virtual-hosted-style by default.
Absent => fall back to the SDK default (virtual-hosted-style).
prefix: Option<String>Optional key prefix prepended to every fetched object. Final
key is {prefix}{hex[0..2]}/{hex}. Validation rejects
prefix starting with /, containing .., containing
backslash, or containing ASCII control / whitespace
characters; auto-appends a trailing / if the prefix is
non-empty and missing one (mirrors parse_origin_url’s
trailing-slash normalization).
credentials: Option<S3Credentials>Credential source. Absent => use the AWS default credential
chain (env vars, ~/.aws/credentials, IAM role / instance
profile).
decompress: Option<DecompressMode>How to handle Content-Encoding on the S3 response (#804).
"auto" (default) decompresses gzip/zstd transparently;
"strict" refuses any non-identity encoding. The BLAKE3
content-address is computed over the canonical (decompressed)
form, so "strict" is only safe for origins guaranteed to serve
already-canonical bytes. Mirrors the HTTP origin’s decompress
knob.
Trait Implementations§
Source§impl Clone for S3OriginConfig
impl Clone for S3OriginConfig
Source§impl Debug for S3OriginConfig
impl Debug for S3OriginConfig
Source§impl<'de> Deserialize<'de> for S3OriginConfig
impl<'de> Deserialize<'de> for S3OriginConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for S3OriginConfig
impl RefUnwindSafe for S3OriginConfig
impl Send for S3OriginConfig
impl Sync for S3OriginConfig
impl Unpin for S3OriginConfig
impl UnsafeUnpin for S3OriginConfig
impl UnwindSafe for S3OriginConfig
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<'de, T> BorrowedRpcObject<'de> for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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