aws_sdk_cloudwatchlogs

Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Client for Amazon CloudWatch Logs

Client for invoking operations on Amazon CloudWatch Logs. Each operation on Amazon CloudWatch Logs is a method on this this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.

§Constructing a Client

A Config is required to construct a client. For most use cases, the aws-config crate should be used to automatically resolve this config using aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared across multiple different AWS SDK clients. This config resolution process can be customized by calling aws_config::from_env() instead, which returns a ConfigLoader that uses the builder pattern to customize the default config.

In the simplest case, creating a client looks as follows:

let config = aws_config::load_from_env().await;
let client = aws_sdk_cloudwatchlogs::Client::new(&config);

Occasionally, SDKs may have additional service-specific values that can be set on the Config that is absent from SdkConfig, or slightly different settings for a specific client may be desired. The Builder struct implements From<&SdkConfig>, so setting these specific settings can be done as follows:

let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_cloudwatchlogs::config::Builder::from(&sdk_config)
    .some_service_specific_setting("value")
    .build();

See the aws-config docs and Config for more information on customizing configuration.

Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.

§Using the Client

A client has a function for every operation that can be performed by the service. For example, the AssociateKmsKey operation has a Client::associate_kms_key, function which returns a builder for that operation. The fluent builder ultimately has a send() function that returns an async future that returns a result, as illustrated below:

let result = client.associate_kms_key()
    .log_group_name("example")
    .send()
    .await;

The underlying HTTP requests that get made by this can be modified with the customize_operation function on the fluent builder. See the customize module for more information.

Implementations§

Source§

impl Client

Source

pub fn associate_kms_key(&self) -> AssociateKmsKeyFluentBuilder

Constructs a fluent builder for the AssociateKmsKey operation.

Source§

impl Client

Source

pub fn cancel_export_task(&self) -> CancelExportTaskFluentBuilder

Constructs a fluent builder for the CancelExportTask operation.

Source§

impl Client

Source

pub fn create_delivery(&self) -> CreateDeliveryFluentBuilder

Constructs a fluent builder for the CreateDelivery operation.

Source§

impl Client

Source

pub fn create_export_task(&self) -> CreateExportTaskFluentBuilder

Constructs a fluent builder for the CreateExportTask operation.

Source§

impl Client

Source

pub fn create_log_anomaly_detector( &self, ) -> CreateLogAnomalyDetectorFluentBuilder

Constructs a fluent builder for the CreateLogAnomalyDetector operation.

Source§

impl Client

Source

pub fn create_log_group(&self) -> CreateLogGroupFluentBuilder

Constructs a fluent builder for the CreateLogGroup operation.

Source§

impl Client

Source

pub fn create_log_stream(&self) -> CreateLogStreamFluentBuilder

Constructs a fluent builder for the CreateLogStream operation.

Source§

impl Client

Source

pub fn delete_account_policy(&self) -> DeleteAccountPolicyFluentBuilder

Constructs a fluent builder for the DeleteAccountPolicy operation.

Source§

impl Client

Source

pub fn delete_data_protection_policy( &self, ) -> DeleteDataProtectionPolicyFluentBuilder

Constructs a fluent builder for the DeleteDataProtectionPolicy operation.

Source§

impl Client

Source

pub fn delete_delivery(&self) -> DeleteDeliveryFluentBuilder

Constructs a fluent builder for the DeleteDelivery operation.

Source§

impl Client

Source

pub fn delete_delivery_destination( &self, ) -> DeleteDeliveryDestinationFluentBuilder

Constructs a fluent builder for the DeleteDeliveryDestination operation.

Source§

impl Client

Source

pub fn delete_delivery_destination_policy( &self, ) -> DeleteDeliveryDestinationPolicyFluentBuilder

Constructs a fluent builder for the DeleteDeliveryDestinationPolicy operation.

Source§

impl Client

Source

pub fn delete_delivery_source(&self) -> DeleteDeliverySourceFluentBuilder

Constructs a fluent builder for the DeleteDeliverySource operation.

Source§

impl Client

Source

pub fn delete_destination(&self) -> DeleteDestinationFluentBuilder

Constructs a fluent builder for the DeleteDestination operation.

Source§

impl Client

Source

pub fn delete_index_policy(&self) -> DeleteIndexPolicyFluentBuilder

Constructs a fluent builder for the DeleteIndexPolicy operation.

Source§

impl Client

Source

pub fn delete_log_anomaly_detector( &self, ) -> DeleteLogAnomalyDetectorFluentBuilder

Constructs a fluent builder for the DeleteLogAnomalyDetector operation.

Source§

impl Client

Source

pub fn delete_log_group(&self) -> DeleteLogGroupFluentBuilder

Constructs a fluent builder for the DeleteLogGroup operation.

Source§

impl Client

Source

pub fn delete_log_stream(&self) -> DeleteLogStreamFluentBuilder

Constructs a fluent builder for the DeleteLogStream operation.

Source§

impl Client

Source

pub fn delete_metric_filter(&self) -> DeleteMetricFilterFluentBuilder

Constructs a fluent builder for the DeleteMetricFilter operation.

Source§

impl Client

Source

pub fn delete_query_definition(&self) -> DeleteQueryDefinitionFluentBuilder

Constructs a fluent builder for the DeleteQueryDefinition operation.

Source§

impl Client

Source

pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder

Constructs a fluent builder for the DeleteResourcePolicy operation.

Source§

impl Client

Source

pub fn delete_retention_policy(&self) -> DeleteRetentionPolicyFluentBuilder

Constructs a fluent builder for the DeleteRetentionPolicy operation.

Source§

impl Client

Source

pub fn delete_subscription_filter( &self, ) -> DeleteSubscriptionFilterFluentBuilder

Constructs a fluent builder for the DeleteSubscriptionFilter operation.

Source§

impl Client

Source

pub fn delete_transformer(&self) -> DeleteTransformerFluentBuilder

Constructs a fluent builder for the DeleteTransformer operation.

Source§

impl Client

Source

pub fn describe_account_policies(&self) -> DescribeAccountPoliciesFluentBuilder

Constructs a fluent builder for the DescribeAccountPolicies operation.

Source§

impl Client

Source

pub fn describe_configuration_templates( &self, ) -> DescribeConfigurationTemplatesFluentBuilder

Constructs a fluent builder for the DescribeConfigurationTemplates operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_deliveries(&self) -> DescribeDeliveriesFluentBuilder

Constructs a fluent builder for the DescribeDeliveries operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_delivery_destinations( &self, ) -> DescribeDeliveryDestinationsFluentBuilder

Constructs a fluent builder for the DescribeDeliveryDestinations operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_delivery_sources(&self) -> DescribeDeliverySourcesFluentBuilder

Constructs a fluent builder for the DescribeDeliverySources operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_destinations(&self) -> DescribeDestinationsFluentBuilder

Constructs a fluent builder for the DescribeDestinations operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_export_tasks(&self) -> DescribeExportTasksFluentBuilder

Constructs a fluent builder for the DescribeExportTasks operation.

Source§

impl Client

Source

pub fn describe_field_indexes(&self) -> DescribeFieldIndexesFluentBuilder

Constructs a fluent builder for the DescribeFieldIndexes operation.

Source§

impl Client

Source

pub fn describe_index_policies(&self) -> DescribeIndexPoliciesFluentBuilder

Constructs a fluent builder for the DescribeIndexPolicies operation.

Source§

impl Client

Source

pub fn describe_log_groups(&self) -> DescribeLogGroupsFluentBuilder

Constructs a fluent builder for the DescribeLogGroups operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_log_streams(&self) -> DescribeLogStreamsFluentBuilder

Constructs a fluent builder for the DescribeLogStreams operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_metric_filters(&self) -> DescribeMetricFiltersFluentBuilder

Constructs a fluent builder for the DescribeMetricFilters operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn describe_queries(&self) -> DescribeQueriesFluentBuilder

Constructs a fluent builder for the DescribeQueries operation.

Source§

impl Client

Source

pub fn describe_query_definitions( &self, ) -> DescribeQueryDefinitionsFluentBuilder

Constructs a fluent builder for the DescribeQueryDefinitions operation.

Source§

impl Client

Source

pub fn describe_resource_policies( &self, ) -> DescribeResourcePoliciesFluentBuilder

Constructs a fluent builder for the DescribeResourcePolicies operation.

Source§

impl Client

Source

pub fn describe_subscription_filters( &self, ) -> DescribeSubscriptionFiltersFluentBuilder

Constructs a fluent builder for the DescribeSubscriptionFilters operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn disassociate_kms_key(&self) -> DisassociateKmsKeyFluentBuilder

Constructs a fluent builder for the DisassociateKmsKey operation.

  • The fluent builder is configurable:
    • log_group_name(impl Into<String>) / set_log_group_name(Option<String>):
      required: false

      The name of the log group.

      In your DisassociateKmsKey operation, you must specify either the resourceIdentifier parameter or the logGroup parameter, but you can’t specify both.


    • resource_identifier(impl Into<String>) / set_resource_identifier(Option<String>):
      required: false

      Specifies the target for this operation. You must specify one of the following:

      • Specify the ARN of a log group to stop having CloudWatch Logs use the KMS key to encrypt log events that are ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace REGION and ACCOUNT_ID with your Region and account ID.

        arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME

      • Specify the following ARN to stop using this key to encrypt the results of future StartQuery operations in this account. Replace REGION and ACCOUNT_ID with your Region and account ID.

        arn:aws:logs:REGION:ACCOUNT_ID:query-result:*

      In your DisssociateKmsKey operation, you must specify either the resourceIdentifier parameter or the logGroup parameter, but you can’t specify both.


  • On success, responds with DisassociateKmsKeyOutput
  • On failure, responds with SdkError<DisassociateKmsKeyError>
Source§

impl Client

Source

pub fn filter_log_events(&self) -> FilterLogEventsFluentBuilder

Constructs a fluent builder for the FilterLogEvents operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn get_data_protection_policy(&self) -> GetDataProtectionPolicyFluentBuilder

Constructs a fluent builder for the GetDataProtectionPolicy operation.

Source§

impl Client

Source

pub fn get_delivery(&self) -> GetDeliveryFluentBuilder

Constructs a fluent builder for the GetDelivery operation.

Source§

impl Client

Source

pub fn get_delivery_destination(&self) -> GetDeliveryDestinationFluentBuilder

Constructs a fluent builder for the GetDeliveryDestination operation.

Source§

impl Client

Source

pub fn get_delivery_destination_policy( &self, ) -> GetDeliveryDestinationPolicyFluentBuilder

Constructs a fluent builder for the GetDeliveryDestinationPolicy operation.

Source§

impl Client

Source

pub fn get_delivery_source(&self) -> GetDeliverySourceFluentBuilder

Constructs a fluent builder for the GetDeliverySource operation.

Source§

impl Client

Source

pub fn get_log_anomaly_detector(&self) -> GetLogAnomalyDetectorFluentBuilder

Constructs a fluent builder for the GetLogAnomalyDetector operation.

Source§

impl Client

Source

pub fn get_log_events(&self) -> GetLogEventsFluentBuilder

Constructs a fluent builder for the GetLogEvents operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn get_log_group_fields(&self) -> GetLogGroupFieldsFluentBuilder

Constructs a fluent builder for the GetLogGroupFields operation.

Source§

impl Client

Source

pub fn get_log_record(&self) -> GetLogRecordFluentBuilder

Constructs a fluent builder for the GetLogRecord operation.

Source§

impl Client

Source

pub fn get_query_results(&self) -> GetQueryResultsFluentBuilder

Constructs a fluent builder for the GetQueryResults operation.

  • The fluent builder is configurable:
  • On success, responds with GetQueryResultsOutput with field(s):
    • results(Option<Vec::<Vec::<ResultField>>>):

      The log events that matched the query criteria during the most recent time it ran.

      The results value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of field/value pairs.

    • statistics(Option<QueryStatistics>):

      Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the scanned log events. These values reflect the full raw results of the query.

    • status(Option<QueryStatus>):

      The status of the most recent running of the query. Possible values are Cancelled, Complete, Failed, Running, Scheduled, Timeout, and Unknown.

      Queries time out after 60 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.

    • encryption_key(Option<String>):

      If you associated an KMS key with the CloudWatch Logs Insights query results in this account, this field displays the ARN of the key that’s used to encrypt the query results when StartQuery stores them.

  • On failure, responds with SdkError<GetQueryResultsError>
Source§

impl Client

Source

pub fn get_transformer(&self) -> GetTransformerFluentBuilder

Constructs a fluent builder for the GetTransformer operation.

Source§

impl Client

Source

pub fn list_anomalies(&self) -> ListAnomaliesFluentBuilder

Constructs a fluent builder for the ListAnomalies operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_log_anomaly_detectors(&self) -> ListLogAnomalyDetectorsFluentBuilder

Constructs a fluent builder for the ListLogAnomalyDetectors operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_log_groups_for_query(&self) -> ListLogGroupsForQueryFluentBuilder

Constructs a fluent builder for the ListLogGroupsForQuery operation. This operation supports pagination; See into_paginator().

Source§

impl Client

Source

pub fn list_tags_for_resource(&self) -> ListTagsForResourceFluentBuilder

Constructs a fluent builder for the ListTagsForResource operation.

Source§

impl Client

Source

pub fn list_tags_log_group(&self) -> ListTagsLogGroupFluentBuilder

👎Deprecated: Please use the generic tagging API ListTagsForResource

Constructs a fluent builder for the ListTagsLogGroup operation.

Source§

impl Client

Source

pub fn put_account_policy(&self) -> PutAccountPolicyFluentBuilder

Constructs a fluent builder for the PutAccountPolicy operation.

  • The fluent builder is configurable:
    • policy_name(impl Into<String>) / set_policy_name(Option<String>):
      required: true

      A name for the policy. This must be unique within the account.


    • policy_document(impl Into<String>) / set_policy_document(Option<String>):
      required: true

      Specify the policy, in JSON.

      Data protection policy

      A data protection policy must include two JSON blocks:

      • The first block must include both a DataIdentifer array and an Operation property with an Audit action. The DataIdentifer array lists the types of sensitive data that you want to mask. For more information about the available options, see Types of data that you can mask.

        The Operation property with an Audit action is required to find the sensitive data terms. This Audit action must contain a FindingsDestination object. You can optionally use that FindingsDestination object to list one or more destinations to send audit findings to. If you specify destinations such as log groups, Firehose streams, and S3 buckets, they must already exist.

      • The second block must include both a DataIdentifer array and an Operation property with an Deidentify action. The DataIdentifer array must exactly match the DataIdentifer array in the first block of the policy.

        The Operation property with the Deidentify action is what actually masks the data, and it must contain the “MaskConfig”: {} object. The “MaskConfig”: {} object must be empty.

      For an example data protection policy, see the Examples section on this page.

      The contents of the two DataIdentifer arrays must match exactly.

      In addition to the two JSON blocks, the policyDocument can also include Name, Description, and Version fields. The Name is different than the operation’s policyName parameter, and is used as a dimension when CloudWatch Logs reports audit findings metrics to CloudWatch.

      The JSON specified in policyDocument can be up to 30,720 characters long.

      Subscription filter policy

      A subscription filter policy can include the following attributes in a JSON block:

      • DestinationArn The ARN of the destination to deliver log events to. Supported destinations are:

        • An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.

        • An Firehose data stream in the same account as the subscription policy, for same-account delivery.

        • A Lambda function in the same account as the subscription policy, for same-account delivery.

        • A logical destination in a different account created with PutDestination, for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.

      • RoleArn The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don’t need to provide the ARN when you are working with a logical destination for cross-account delivery.

      • FilterPattern A filter pattern for subscribing to a filtered stream of log events.

      • Distribution The method used to distribute log data to the destination. By default, log data is grouped by log stream, but the grouping can be set to Random for a more even distribution. This property is only applicable when the destination is an Kinesis Data Streams data stream.

      Transformer policy

      A transformer policy must include one JSON block with the array of processors and their configurations. For more information about available processors, see Processors that you can use.

      Field index policy

      A field index filter policy can include the following attribute in a JSON block:

      • Fields The array of field indexes to create.

      It must contain at least one field index.

      The following is an example of an index policy document that creates two indexes, RequestId and TransactionId.

      “policyDocument”: “{ "Fields": [ "RequestId", "TransactionId" ] }”


    • policy_type(PolicyType) / set_policy_type(Option<PolicyType>):
      required: true

      The type of policy that you’re creating or updating.


    • scope(Scope) / set_scope(Option<Scope>):
      required: false

      Currently the only valid value for this parameter is ALL, which specifies that the data protection policy applies to all log groups in the account. If you omit this parameter, the default of ALL is used.


    • selection_criteria(impl Into<String>) / set_selection_criteria(Option<String>):
      required: false

      Use this parameter to apply the new policy to a subset of log groups in the account.

      Specifing selectionCriteria is valid only when you specify SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICYfor policyType.

      If policyType is SUBSCRIPTION_FILTER_POLICY, the only supported selectionCriteria filter is LogGroupName NOT IN []

      If policyType is FIELD_INDEX_POLICY or TRANSFORMER_POLICY, the only supported selectionCriteria filter is LogGroupNamePrefix

      The selectionCriteria string can be up to 25KB in length. The length is determined by using its UTF-8 bytes.

      Using the selectionCriteria parameter with SUBSCRIPTION_FILTER_POLICY is useful to help prevent infinite loops. For more information, see Log recursion prevention.


  • On success, responds with PutAccountPolicyOutput with field(s):
  • On failure, responds with SdkError<PutAccountPolicyError>
Source§

impl Client

Source

pub fn put_data_protection_policy(&self) -> PutDataProtectionPolicyFluentBuilder

Constructs a fluent builder for the PutDataProtectionPolicy operation.

  • The fluent builder is configurable:
    • log_group_identifier(impl Into<String>) / set_log_group_identifier(Option<String>):
      required: true

      Specify either the log group name or log group ARN.


    • policy_document(impl Into<String>) / set_policy_document(Option<String>):
      required: true

      Specify the data protection policy, in JSON.

      This policy must include two JSON blocks:

      • The first block must include both a DataIdentifer array and an Operation property with an Audit action. The DataIdentifer array lists the types of sensitive data that you want to mask. For more information about the available options, see Types of data that you can mask.

        The Operation property with an Audit action is required to find the sensitive data terms. This Audit action must contain a FindingsDestination object. You can optionally use that FindingsDestination object to list one or more destinations to send audit findings to. If you specify destinations such as log groups, Firehose streams, and S3 buckets, they must already exist.

      • The second block must include both a DataIdentifer array and an Operation property with an Deidentify action. The DataIdentifer array must exactly match the DataIdentifer array in the first block of the policy.

        The Operation property with the Deidentify action is what actually masks the data, and it must contain the “MaskConfig”: {} object. The “MaskConfig”: {} object must be empty.

      For an example data protection policy, see the Examples section on this page.

      The contents of the two DataIdentifer arrays must match exactly.

      In addition to the two JSON blocks, the policyDocument can also include Name, Description, and Version fields. The Name is used as a dimension when CloudWatch Logs reports audit findings metrics to CloudWatch.

      The JSON specified in policyDocument can be up to 30,720 characters.


  • On success, responds with PutDataProtectionPolicyOutput with field(s):
  • On failure, responds with SdkError<PutDataProtectionPolicyError>
Source§

impl Client

Source

pub fn put_delivery_destination(&self) -> PutDeliveryDestinationFluentBuilder

Constructs a fluent builder for the PutDeliveryDestination operation.

Source§

impl Client

Source

pub fn put_delivery_destination_policy( &self, ) -> PutDeliveryDestinationPolicyFluentBuilder

Constructs a fluent builder for the PutDeliveryDestinationPolicy operation.

Source§

impl Client

Source

pub fn put_delivery_source(&self) -> PutDeliverySourceFluentBuilder

Constructs a fluent builder for the PutDeliverySource operation.

Source§

impl Client

Source

pub fn put_destination(&self) -> PutDestinationFluentBuilder

Constructs a fluent builder for the PutDestination operation.

Source§

impl Client

Source

pub fn put_destination_policy(&self) -> PutDestinationPolicyFluentBuilder

Constructs a fluent builder for the PutDestinationPolicy operation.

Source§

impl Client

Source

pub fn put_index_policy(&self) -> PutIndexPolicyFluentBuilder

Constructs a fluent builder for the PutIndexPolicy operation.

Source§

impl Client

Source

pub fn put_log_events(&self) -> PutLogEventsFluentBuilder

Constructs a fluent builder for the PutLogEvents operation.

Source§

impl Client

Source

pub fn put_metric_filter(&self) -> PutMetricFilterFluentBuilder

Constructs a fluent builder for the PutMetricFilter operation.

Source§

impl Client

Source

pub fn put_query_definition(&self) -> PutQueryDefinitionFluentBuilder

Constructs a fluent builder for the PutQueryDefinition operation.

Source§

impl Client

Source

pub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder

Constructs a fluent builder for the PutResourcePolicy operation.

  • The fluent builder is configurable:
    • policy_name(impl Into<String>) / set_policy_name(Option<String>):
      required: false

      Name of the new policy. This parameter is required.


    • policy_document(impl Into<String>) / set_policy_document(Option<String>):
      required: false

      Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.

      The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace “logArn” with the ARN of your CloudWatch Logs resource, such as a log group or log stream.

      CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.

      In the example resource policy, you would replace the value of SourceArn with the resource making the call from Route 53 to CloudWatch Logs. You would also replace the value of SourceAccount with the Amazon Web Services account ID making that call.

      { “Version”: “2012-10-17”, “Statement”: [ { “Sid”: “Route53LogsToCloudWatchLogs”, “Effect”: “Allow”, “Principal”: { “Service”: [ “route53.amazonaws.com” ] }, “Action”: “logs:PutLogEvents”, “Resource”: “logArn”, “Condition”: { “ArnLike”: { “aws:SourceArn”: “myRoute53ResourceArn” }, “StringEquals”: { “aws:SourceAccount”: “myAwsAccountId” } } } ] }


  • On success, responds with PutResourcePolicyOutput with field(s):
  • On failure, responds with SdkError<PutResourcePolicyError>
Source§

impl Client

Source

pub fn put_retention_policy(&self) -> PutRetentionPolicyFluentBuilder

Constructs a fluent builder for the PutRetentionPolicy operation.

Source§

impl Client

Source

pub fn put_subscription_filter(&self) -> PutSubscriptionFilterFluentBuilder

Constructs a fluent builder for the PutSubscriptionFilter operation.

Source§

impl Client

Source

pub fn put_transformer(&self) -> PutTransformerFluentBuilder

Constructs a fluent builder for the PutTransformer operation.

Source§

impl Client

Source

pub fn start_query(&self) -> StartQueryFluentBuilder

Constructs a fluent builder for the StartQuery operation.

Source§

impl Client

Source

pub fn stop_query(&self) -> StopQueryFluentBuilder

Constructs a fluent builder for the StopQuery operation.

Source§

impl Client

Source

pub fn tag_log_group(&self) -> TagLogGroupFluentBuilder

👎Deprecated: Please use the generic tagging API TagResource

Constructs a fluent builder for the TagLogGroup operation.

Source§

impl Client

Source

pub fn tag_resource(&self) -> TagResourceFluentBuilder

Constructs a fluent builder for the TagResource operation.

Source§

impl Client

Source

pub fn test_metric_filter(&self) -> TestMetricFilterFluentBuilder

Constructs a fluent builder for the TestMetricFilter operation.

Source§

impl Client

Source

pub fn test_transformer(&self) -> TestTransformerFluentBuilder

Constructs a fluent builder for the TestTransformer operation.

Source§

impl Client

Source

pub fn untag_log_group(&self) -> UntagLogGroupFluentBuilder

👎Deprecated: Please use the generic tagging API UntagResource

Constructs a fluent builder for the UntagLogGroup operation.

Source§

impl Client

Source

pub fn untag_resource(&self) -> UntagResourceFluentBuilder

Constructs a fluent builder for the UntagResource operation.

Source§

impl Client

Source

pub fn update_anomaly(&self) -> UpdateAnomalyFluentBuilder

Constructs a fluent builder for the UpdateAnomaly operation.

Source§

impl Client

Source

pub fn update_delivery_configuration( &self, ) -> UpdateDeliveryConfigurationFluentBuilder

Constructs a fluent builder for the UpdateDeliveryConfiguration operation.

Source§

impl Client

Source

pub fn update_log_anomaly_detector( &self, ) -> UpdateLogAnomalyDetectorFluentBuilder

Constructs a fluent builder for the UpdateLogAnomalyDetector operation.

Source§

impl Client

Source

pub fn from_conf(conf: Config) -> Self

Creates a new client from the service Config.

§Panics

This method will panic in the following cases:

  • Retries or timeouts are enabled without a sleep_impl configured.
  • Identity caching is enabled without a sleep_impl and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

Source

pub fn config(&self) -> &Config

Returns the client’s configuration.

Source§

impl Client

Source

pub fn new(sdk_config: &SdkConfig) -> Self

Creates a new client from an SDK Config.

§Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.
  • This method will panic if no BehaviorVersion is provided. If you experience this panic, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to Color::Primary.

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to Color::Fixed.

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to Color::Rgb.

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to Color::Black.

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to Color::Red.

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to Color::Green.

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to Color::Yellow.

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to Color::Blue.

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to Color::Magenta.

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to Color::Cyan.

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to Color::White.

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightBlack.

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightRed.

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightGreen.

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightYellow.

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightBlue.

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightMagenta.

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightCyan.

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to Color::BrightWhite.

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to Color::Primary.

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to Color::Fixed.

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to Color::Rgb.

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to Color::Black.

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to Color::Red.

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to Color::Green.

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to Color::Yellow.

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to Color::Blue.

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to Color::Magenta.

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to Color::Cyan.

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to Color::White.

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightBlack.

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightRed.

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightGreen.

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightYellow.

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightBlue.

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightMagenta.

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightCyan.

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to Color::BrightWhite.

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Bold.

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Dim.

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Italic.

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Underline.

§Example
println!("{}", value.underline());

Returns self with the attr() set to Attribute::Blink.

§Example
println!("{}", value.blink());

Returns self with the attr() set to Attribute::RapidBlink.

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Invert.

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Conceal.

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to Attribute::Strike.

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::Mask.

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::Wrap.

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::Linger.

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to Quirk::Clear.

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::Resetting.

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::Bright.

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to Quirk::OnBright.

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T