pub struct ConfigBuilder { /* private fields */ }
Expand description
Config builder for creating a new config.
§Examples
use aliyun_log_rust_sdk::FromConfig;
let config = aliyun_log_rust_sdk::Config::builder()
.endpoint("cn-hangzhou.log.aliyuncs.com")
.access_key("access_key_id", "access_key_secret")
.request_timeout(std::time::Duration::from_secs(60))
.connection_timeout(std::time::Duration::from_secs(10))
.build()?;
let client = aliyun_log_rust_sdk::Client::from_config(config)?;
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn new() -> Self
Sourcepub fn endpoint(self, endpoint: impl Into<String>) -> Self
pub fn endpoint(self, endpoint: impl Into<String>) -> Self
Set the endpoint for the Aliyun Log Service.
§Arguments
endpoint
- The endpoint, e.g. “cn-hangzhou.log.aliyuncs.com”
Sourcepub fn access_key(
self,
access_key_id: impl Into<String>,
access_key_secret: impl Into<String>,
) -> Self
pub fn access_key( self, access_key_id: impl Into<String>, access_key_secret: impl Into<String>, ) -> Self
Set the access key ID and secret for authentication.
§Arguments
access_key_id
- The access key IDaccess_key_secret
- The access key secret
Sourcepub fn sts(
self,
access_key_id: impl Into<String>,
access_key_secret: impl Into<String>,
security_token: impl Into<String>,
) -> Self
pub fn sts( self, access_key_id: impl Into<String>, access_key_secret: impl Into<String>, security_token: impl Into<String>, ) -> Self
Set temporary security token for STS authentication.
§Arguments
access_key_id
- The temporary access key IDaccess_key_secret
- The temporary access key secretsecurity_token
- The security token
Sourcepub fn connection_timeout(self, connection_timeout: Duration) -> Self
pub fn connection_timeout(self, connection_timeout: Duration) -> Self
Sourcepub fn request_timeout(self, request_timeout: Duration) -> Self
pub fn request_timeout(self, request_timeout: Duration) -> Self
Sourcepub fn build(self) -> Result<Config, ConfigError>
pub fn build(self) -> Result<Config, ConfigError>
Build the client with the configured settings.
Trait Implementations§
Source§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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