Skip to main content

GcsConfig

Struct GcsConfig 

Source
pub struct GcsConfig {
Show 13 fields pub bucket: String, pub prefix: Option<String>, pub service_account_path: Option<String>, pub service_account_key: Option<String>, pub application_credentials_path: Option<String>, pub endpoint: Option<String>, pub allow_http: bool, pub multipart_threshold: u64, pub multipart_chunk_size: usize, pub max_retries: usize, pub retry_timeout: Duration, pub request_timeout: Duration, pub connect_timeout: Duration,
}
Expand description

Connection and bucket parameters for native Google Cloud Storage.

If every credential field is None, the config selects Workload Identity or ADC through the metadata server. This is the keyless GKE production path.

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

Fields§

§bucket: String

GCS bucket name.

§prefix: Option<String>

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

§service_account_path: Option<String>

Optional path to a service-account JSON key file.

§service_account_key: Option<String>

Optional inline service-account JSON key. It is mutually exclusive with the path.

§application_credentials_path: Option<String>

Optional path to an application-default-credentials JSON file.

§endpoint: Option<String>

Optional custom GCS API base URL, for example http://fake-gcs:4443.

§allow_http: bool

Allow plaintext HTTP. Emulators without TLS require it.

§multipart_threshold: u64

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

§multipart_chunk_size: usize

Per-part size for multipart. Defaults to DEFAULT_MULTIPART_CHUNK_SIZE.

§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 GcsConfig

Source§

fn clone(&self) -> GcsConfig

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 GcsConfig

Source§

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

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

impl Default for GcsConfig

Source§

fn default() -> Self

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

impl Eq for GcsConfig

Source§

impl PartialEq for GcsConfig

Source§

fn eq(&self, other: &GcsConfig) -> 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 GcsConfig

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