Skip to main content

S3Config

Struct S3Config 

Source
pub struct S3Config {
Show 15 fields pub bucket: String, pub prefix: Option<String>, pub region: String, pub endpoint: Option<String>, pub access_key_id: Option<String>, pub secret_access_key: Option<String>, pub allow_http: bool, pub multipart_threshold: u64, pub multipart_chunk_size: usize, pub conditional_put: bool, pub checksum_sha256: bool, pub max_retries: usize, pub retry_timeout: Duration, pub request_timeout: Duration, pub connect_timeout: Duration,
}
Expand description

Connection and bucket parameters for an S3-compatible backend.

The credentials come either from access_key_id and secret_access_key or from the standard AWS credential chain. When both fields are None, object_store falls back to the environment-variable chain.

Debug redacts the credential fields, so a stray {:?} call or tracing call never leaks them.

Fields§

§bucket: String

S3 bucket name.

§prefix: Option<String>

Optional key prefix inside the bucket. No leading slash and no trailing slash.

§region: String

AWS region. AWS S3 requires it. Use the placeholder "us-east-1" for MinIO and R2.

§endpoint: Option<String>

Optional custom endpoint URL, for example http://minio:9000 or an R2 endpoint.

§access_key_id: Option<String>

Optional explicit access key id. Without it, the backend falls back to the AWS credential chain.

§secret_access_key: Option<String>

Optional explicit secret access key. Without it, the backend falls back to the AWS credential chain.

§allow_http: bool

Allow plaintext HTTP. MinIO without TLS requires it.

§multipart_threshold: u64

Files of at least this size upload with multipart. Defaults to DEFAULT_MULTIPART_THRESHOLD.

§multipart_chunk_size: usize

Per-part size for multipart. Defaults to DEFAULT_MULTIPART_CHUNK_SIZE.

§conditional_put: bool

Enable conditional puts (If-None-Match) so a PutMode::Create write fails instead of silently overwriting. Defaults to true.

§checksum_sha256: bool

Send x-amz-checksum-sha256 so the server verifies each object on ingest. Defaults to true.

§max_retries: usize

How many times one request is retried before the error surfaces. Defaults to DEFAULT_MAX_RETRIES; 0 disables retries.

§retry_timeout: Duration

Ceiling on the wall-clock time one request may spend across all of its retries. Defaults to DEFAULT_RETRY_TIMEOUT.

§request_timeout: Duration

Ceiling on one HTTP request. Defaults to DEFAULT_REQUEST_TIMEOUT.

§connect_timeout: Duration

Ceiling on the connect phase alone. Defaults to DEFAULT_CONNECT_TIMEOUT.

Trait Implementations§

Source§

impl Clone for S3Config

Source§

fn clone(&self) -> S3Config

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 S3Config

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for S3Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for S3Config

Source§

impl PartialEq for S3Config

Source§

fn eq(&self, other: &S3Config) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for S3Config

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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