pub struct Config { /* private fields */ }Expand description
Configuration for the AWS CloudWatch service.
This struct holds all necessary credentials and identifiers to authenticate and send logs to a specific CloudWatch Log Group.
§Note
While this configuration is explicit, the underlying SDK can often fall back to environment variables if certain fields are left as default.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new<S1, S2, S3, S4>(
access_key_id: S1,
access_key_secret: S2,
log_group: S3,
region: S4,
) -> Self
pub fn new<S1, S2, S3, S4>( access_key_id: S1, access_key_secret: S2, log_group: S3, region: S4, ) -> Self
Creates a new Config instance with required parameters.
§Arguments
access_key_id- The AWS Access Key.access_key_secret- The AWS Secret Key.log_group- The target CloudWatch Log Group name.region- The AWS region string.
§Defaults:
provider: “timber-rust”
§Example
let config = Config::new("AKIA...", "secret", "my-logs", "us-east-1");Sourcepub fn get_access_key_id(&self) -> &str
pub fn get_access_key_id(&self) -> &str
Returns the AWS Access Key ID.
Sourcepub fn get_access_key_secret(&self) -> &str
pub fn get_access_key_secret(&self) -> &str
Returns the AWS Secret Access Key.
Sourcepub fn get_session_token(&self) -> Option<&str>
pub fn get_session_token(&self) -> Option<&str>
Returns the AWS Session Token, if any.
Sourcepub fn get_expires_in(&self) -> Option<SystemTime>
pub fn get_expires_in(&self) -> Option<SystemTime>
Returns the expiration time of the credentials in seconds.
Sourcepub fn get_log_group(&self) -> &str
pub fn get_log_group(&self) -> &str
Returns the target CloudWatch Log Group name.
Sourcepub fn get_region(&self) -> &str
pub fn get_region(&self) -> &str
Returns the AWS Region string.
Sourcepub fn get_provider(&self) -> &'static str
pub fn get_provider(&self) -> &'static str
Returns the provider name string.
Sourcepub fn access_key_id(self, v: impl Into<String>) -> Self
pub fn access_key_id(self, v: impl Into<String>) -> Self
Sets the AWS Access Key ID.
Sourcepub fn access_key_secret(self, v: impl Into<String>) -> Self
pub fn access_key_secret(self, v: impl Into<String>) -> Self
Sets the AWS Secret Access Key.
Sourcepub fn session_token(self, v: Option<impl Into<String>>) -> Self
pub fn session_token(self, v: Option<impl Into<String>>) -> Self
Sets an optional AWS Session Token.
Sourcepub fn expires_in(self, v: Option<SystemTime>) -> Self
pub fn expires_in(self, v: Option<SystemTime>) -> Self
Sets the credential expiration time (in seconds).
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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