pub struct Config {
pub region: String,
pub endpoint: String,
pub disable_ssl: bool,
pub credentials: Credentials,
}Expand description
Represents the configuration settings required for connecting to Volcengine services.
The Config struct holds essential parameters such as the service region, endpoint,
SSL settings, and authentication credentials. It is designed to be used with a builder
pattern (ConfigBuilder) to allow flexible and structured configuration.
§Fields
region(String): Specifies the geographical region for the service.endpoint(String): The base URL of the API service. If manually set, this overrides the default endpoint.disable_ssl(bool): Determines whether SSL/TLS is disabled.true: SSL is disabled (not recommended for production).false: SSL is enabled for secure communication.
credentials(credentials::Credentials): Stores authentication credentials, including access keys and secret keys, required for making API requests.
§Example
let config = Config {
region: "us-west-2".to_string(),
endpoint: "https://api.volcengine.com".to_string(),
disable_ssl: false,
credentials: credentials::Credentials::new("access_key", "secret_key"),
};Fields§
§region: String§endpoint: String§disable_ssl: bool§credentials: CredentialsImplementations§
Source§impl Config
Implementation of the Config struct, providing utility methods
for managing application configuration settings.
impl Config
Implementation of the Config struct, providing utility methods
for managing application configuration settings.
This implementation includes a builder method to facilitate
constructing a Config instance step-by-step using the ConfigBuilder.
§Key Functionalities
builder(): Returns a newConfigBuilderinstance with default values,
allowing users to set configuration properties before building aConfigobject.
The Config struct encapsulates essential configuration parameters such as
service region, endpoint URL, SSL settings, and authentication credentials.
This implementation ensures that configuration objects are created in
a structured and validated manner.
Sourcepub fn builder() -> ConfigBuilder
pub fn builder() -> ConfigBuilder
Creates a new ConfigBuilder instance to facilitate the construction of a Config object.
This method returns a ConfigBuilder with default values, allowing users to configure
the settings step by step before building a complete Config instance.
§Example
let builder = Config::builder();Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request