pub struct S3Config {
pub bucket: String,
pub region: String,
pub access_key: String,
pub secret_key: String,
pub endpoint: String,
}Available on crate features
storage-azure or storage-gcs or storage-local or storage-s3 only.Expand description
Connection details for an S3-compatible bucket.
Fields§
§bucket: String§region: String§access_key: StringEmpty string means “no static key — auto-detect workload identity
(EKS IRSA, ECS task role, EC2 IMDSv2) instead”. See
S3Storage::new.
secret_key: StringEmpty string means “no static key — auto-detect workload identity”.
See S3Storage::new.
endpoint: StringScheme + host, e.g. https://s3.us-east-1.amazonaws.com. Point this
at a custom host to use Cloudflare R2, MinIO, or any other
S3-compatible provider.
Implementations§
Source§impl S3Config
impl S3Config
Sourcepub fn from_env() -> Result<S3Config, StorageError>
pub fn from_env() -> Result<S3Config, StorageError>
Read configuration from environment variables.
| Variable | Default |
|---|---|
RWS_S3_BUCKET | (required) |
RWS_S3_REGION | us-east-1 |
RWS_S3_ACCESS_KEY | optional — falls back to workload identity (IRSA/ECS/IMDS) when unset |
RWS_S3_SECRET_KEY | optional — falls back to workload identity (IRSA/ECS/IMDS) when unset |
RWS_S3_ENDPOINT | https://s3.{region}.amazonaws.com (http:// works too) |
S3Storage::from_env also reads RWS_S3_CA_FILE.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for S3Config
impl RefUnwindSafe for S3Config
impl Send for S3Config
impl Sync for S3Config
impl Unpin for S3Config
impl UnsafeUnpin for S3Config
impl UnwindSafe for S3Config
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
Mutably borrows from an owned value. Read more
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,
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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more