pub struct Client { /* private fields */ }
Expand description
Client for AWS X-Ray
Client for invoking operations on AWS X-Ray. Each operation on AWS X-Ray 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_xray::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_xray::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 BatchGetTraces
operation has
a Client::batch_get_traces
, 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.batch_get_traces()
.next_token("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
impl Client
Sourcepub fn batch_get_traces(&self) -> BatchGetTracesFluentBuilder
pub fn batch_get_traces(&self) -> BatchGetTracesFluentBuilder
Constructs a fluent builder for the BatchGetTraces
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
trace_ids(impl Into<String>)
/set_trace_ids(Option<Vec::<String>>)
:
required: trueSpecify the trace IDs of requests for which to retrieve segments.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
BatchGetTracesOutput
with field(s):traces(Option<Vec::<Trace>>)
:Full traces for the specified requests.
unprocessed_trace_ids(Option<Vec::<String>>)
:Trace IDs of requests that haven’t been processed.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<BatchGetTracesError>
Source§impl Client
impl Client
Sourcepub fn cancel_trace_retrieval(&self) -> CancelTraceRetrievalFluentBuilder
pub fn cancel_trace_retrieval(&self) -> CancelTraceRetrievalFluentBuilder
Constructs a fluent builder for the CancelTraceRetrieval
operation.
- The fluent builder is configurable:
retrieval_token(impl Into<String>)
/set_retrieval_token(Option<String>)
:
required: trueRetrieval token.
- On success, responds with
CancelTraceRetrievalOutput
- On failure, responds with
SdkError<CancelTraceRetrievalError>
Source§impl Client
impl Client
Sourcepub fn create_group(&self) -> CreateGroupFluentBuilder
pub fn create_group(&self) -> CreateGroupFluentBuilder
Constructs a fluent builder for the CreateGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: trueThe case-sensitive name of the new group. Default is a reserved name and names must be unique.
filter_expression(impl Into<String>)
/set_filter_expression(Option<String>)
:
required: falseThe filter expression defining criteria by which to group traces.
insights_configuration(InsightsConfiguration)
/set_insights_configuration(Option<InsightsConfiguration>)
:
required: falseThe structure containing configurations related to insights.
-
The InsightsEnabled boolean can be set to true to enable insights for the new group or false to disable insights for the new group.
-
The NotificationsEnabled boolean can be set to true to enable insights notifications for the new group. Notifications may only be enabled on a group with InsightsEnabled set to true.
-
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA map that contains one or more tag keys and tag values to attach to an X-Ray group. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.
The following restrictions apply to tags:
-
Maximum number of user-applied tags per resource: 50
-
Maximum tag key length: 128 Unicode characters
-
Maximum tag value length: 256 Unicode characters
-
Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @
-
Tag keys and values are case sensitive.
-
Don’t use
aws:
as a prefix for keys; it’s reserved for Amazon Web Services use.
-
- On success, responds with
CreateGroupOutput
with field(s):group(Option<Group>)
:The group that was created. Contains the name of the group that was created, the Amazon Resource Name (ARN) of the group that was generated based on the group name, the filter expression, and the insight configuration that was assigned to the group.
- On failure, responds with
SdkError<CreateGroupError>
Source§impl Client
impl Client
Sourcepub fn create_sampling_rule(&self) -> CreateSamplingRuleFluentBuilder
pub fn create_sampling_rule(&self) -> CreateSamplingRuleFluentBuilder
Constructs a fluent builder for the CreateSamplingRule
operation.
- The fluent builder is configurable:
sampling_rule(SamplingRule)
/set_sampling_rule(Option<SamplingRule>)
:
required: trueThe rule definition.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA map that contains one or more tag keys and tag values to attach to an X-Ray sampling rule. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.
The following restrictions apply to tags:
-
Maximum number of user-applied tags per resource: 50
-
Maximum tag key length: 128 Unicode characters
-
Maximum tag value length: 256 Unicode characters
-
Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @
-
Tag keys and values are case sensitive.
-
Don’t use
aws:
as a prefix for keys; it’s reserved for Amazon Web Services use.
-
- On success, responds with
CreateSamplingRuleOutput
with field(s):sampling_rule_record(Option<SamplingRuleRecord>)
:The saved rule definition and metadata.
- On failure, responds with
SdkError<CreateSamplingRuleError>
Source§impl Client
impl Client
Sourcepub fn delete_group(&self) -> DeleteGroupFluentBuilder
pub fn delete_group(&self) -> DeleteGroupFluentBuilder
Constructs a fluent builder for the DeleteGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe case-sensitive name of the group.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe ARN of the group that was generated on creation.
- On success, responds with
DeleteGroupOutput
- On failure, responds with
SdkError<DeleteGroupError>
Source§impl Client
impl Client
Sourcepub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
Constructs a fluent builder for the DeleteResourcePolicy
operation.
- The fluent builder is configurable:
policy_name(impl Into<String>)
/set_policy_name(Option<String>)
:
required: trueThe name of the resource policy to delete.
policy_revision_id(impl Into<String>)
/set_policy_revision_id(Option<String>)
:
required: falseSpecifies a specific policy revision to delete. Provide a
PolicyRevisionId
to ensure an atomic delete operation. If the provided revision id does not match the latest policy revision id, anInvalidPolicyRevisionIdException
exception is returned.
- On success, responds with
DeleteResourcePolicyOutput
- On failure, responds with
SdkError<DeleteResourcePolicyError>
Source§impl Client
impl Client
Sourcepub fn delete_sampling_rule(&self) -> DeleteSamplingRuleFluentBuilder
pub fn delete_sampling_rule(&self) -> DeleteSamplingRuleFluentBuilder
Constructs a fluent builder for the DeleteSamplingRule
operation.
- The fluent builder is configurable:
rule_name(impl Into<String>)
/set_rule_name(Option<String>)
:
required: falseThe name of the sampling rule. Specify a rule by either name or ARN, but not both.
rule_arn(impl Into<String>)
/set_rule_arn(Option<String>)
:
required: falseThe ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
- On success, responds with
DeleteSamplingRuleOutput
with field(s):sampling_rule_record(Option<SamplingRuleRecord>)
:The deleted rule definition and metadata.
- On failure, responds with
SdkError<DeleteSamplingRuleError>
Source§impl Client
impl Client
Sourcepub fn get_encryption_config(&self) -> GetEncryptionConfigFluentBuilder
pub fn get_encryption_config(&self) -> GetEncryptionConfigFluentBuilder
Constructs a fluent builder for the GetEncryptionConfig
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetEncryptionConfigOutput
with field(s):encryption_config(Option<EncryptionConfig>)
:The encryption configuration document.
- On failure, responds with
SdkError<GetEncryptionConfigError>
Source§impl Client
impl Client
Sourcepub fn get_group(&self) -> GetGroupFluentBuilder
pub fn get_group(&self) -> GetGroupFluentBuilder
Constructs a fluent builder for the GetGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe case-sensitive name of the group.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe ARN of the group that was generated on creation.
- On success, responds with
GetGroupOutput
with field(s):group(Option<Group>)
:The group that was requested. Contains the name of the group, the ARN of the group, the filter expression, and the insight configuration assigned to the group.
- On failure, responds with
SdkError<GetGroupError>
Source§impl Client
impl Client
Sourcepub fn get_groups(&self) -> GetGroupsFluentBuilder
pub fn get_groups(&self) -> GetGroupsFluentBuilder
Constructs a fluent builder for the GetGroups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetGroupsOutput
with field(s):groups(Option<Vec::<GroupSummary>>)
:The collection of all active groups.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetGroupsError>
Source§impl Client
impl Client
Sourcepub fn get_indexing_rules(&self) -> GetIndexingRulesFluentBuilder
pub fn get_indexing_rules(&self) -> GetIndexingRulesFluentBuilder
Constructs a fluent builder for the GetIndexingRules
operation.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of indexes.
- On success, responds with
GetIndexingRulesOutput
with field(s):indexing_rules(Option<Vec::<IndexingRule>>)
:Retrieves all indexing rules.
next_token(Option<String>)
:Specify the pagination token returned by a previous request to retrieve the next page of indexes.
- On failure, responds with
SdkError<GetIndexingRulesError>
Source§impl Client
impl Client
Sourcepub fn get_insight(&self) -> GetInsightFluentBuilder
pub fn get_insight(&self) -> GetInsightFluentBuilder
Constructs a fluent builder for the GetInsight
operation.
- The fluent builder is configurable:
insight_id(impl Into<String>)
/set_insight_id(Option<String>)
:
required: trueThe insight’s unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
- On success, responds with
GetInsightOutput
with field(s):insight(Option<Insight>)
:The summary information of an insight.
- On failure, responds with
SdkError<GetInsightError>
Source§impl Client
impl Client
Sourcepub fn get_insight_events(&self) -> GetInsightEventsFluentBuilder
pub fn get_insight_events(&self) -> GetInsightEventsFluentBuilder
Constructs a fluent builder for the GetInsightEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
insight_id(impl Into<String>)
/set_insight_id(Option<String>)
:
required: trueThe insight’s unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseUsed to retrieve at most the specified value of events.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of events.
- On success, responds with
GetInsightEventsOutput
with field(s):insight_events(Option<Vec::<InsightEvent>>)
:A detailed description of the event. This includes the time of the event, client and root cause impact statistics, and the top anomalous service at the time of the event.
next_token(Option<String>)
:Use this token to retrieve the next page of insight events.
- On failure, responds with
SdkError<GetInsightEventsError>
Source§impl Client
impl Client
Sourcepub fn get_insight_impact_graph(&self) -> GetInsightImpactGraphFluentBuilder
pub fn get_insight_impact_graph(&self) -> GetInsightImpactGraphFluentBuilder
Constructs a fluent builder for the GetInsightImpactGraph
operation.
- The fluent builder is configurable:
insight_id(impl Into<String>)
/set_insight_id(Option<String>)
:
required: trueThe insight’s unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe estimated start time of the insight, in Unix time seconds. The StartTime is inclusive of the value provided and can’t be more than 30 days old.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe estimated end time of the insight, in Unix time seconds. The EndTime is exclusive of the value provided. The time range between the start time and end time can’t be more than six hours.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of results.
- On success, responds with
GetInsightImpactGraphOutput
with field(s):insight_id(Option<String>)
:The insight’s unique identifier.
start_time(Option<DateTime>)
:The provided start time.
end_time(Option<DateTime>)
:The provided end time.
service_graph_start_time(Option<DateTime>)
:The time, in Unix seconds, at which the service graph started.
service_graph_end_time(Option<DateTime>)
:The time, in Unix seconds, at which the service graph ended.
services(Option<Vec::<InsightImpactGraphService>>)
:The Amazon Web Services instrumented services related to the insight.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetInsightImpactGraphError>
Source§impl Client
impl Client
Sourcepub fn get_insight_summaries(&self) -> GetInsightSummariesFluentBuilder
pub fn get_insight_summaries(&self) -> GetInsightSummariesFluentBuilder
Constructs a fluent builder for the GetInsightSummaries
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
states(InsightState)
/set_states(Option<Vec::<InsightState>>)
:
required: falseThe list of insight states.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the group. Required if the GroupName isn’t provided.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe name of the group. Required if the GroupARN isn’t provided.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe beginning of the time frame in which the insights started. The start time can’t be more than 30 days old.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe end of the time frame in which the insights ended. The end time can’t be more than 30 days old.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to display.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetInsightSummariesOutput
with field(s):insight_summaries(Option<Vec::<InsightSummary>>)
:The summary of each insight within the group matching the provided filters. The summary contains the InsightID, start and end time, the root cause service, the root cause and client impact statistics, the top anomalous services, and the status of the insight.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetInsightSummariesError>
Source§impl Client
impl Client
Sourcepub fn get_retrieved_traces_graph(&self) -> GetRetrievedTracesGraphFluentBuilder
pub fn get_retrieved_traces_graph(&self) -> GetRetrievedTracesGraphFluentBuilder
Constructs a fluent builder for the GetRetrievedTracesGraph
operation.
- The fluent builder is configurable:
retrieval_token(impl Into<String>)
/set_retrieval_token(Option<String>)
:
required: trueRetrieval token.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of indexes.
- On success, responds with
GetRetrievedTracesGraphOutput
with field(s):retrieval_status(Option<RetrievalStatus>)
:Status of the retrieval.
services(Option<Vec::<RetrievedService>>)
:Retrieved services.
next_token(Option<String>)
:Specify the pagination token returned by a previous request to retrieve the next page of indexes.
- On failure, responds with
SdkError<GetRetrievedTracesGraphError>
Source§impl Client
impl Client
Sourcepub fn get_sampling_rules(&self) -> GetSamplingRulesFluentBuilder
pub fn get_sampling_rules(&self) -> GetSamplingRulesFluentBuilder
Constructs a fluent builder for the GetSamplingRules
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetSamplingRulesOutput
with field(s):sampling_rule_records(Option<Vec::<SamplingRuleRecord>>)
:Rule definitions and metadata.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetSamplingRulesError>
Source§impl Client
impl Client
Sourcepub fn get_sampling_statistic_summaries(
&self,
) -> GetSamplingStatisticSummariesFluentBuilder
pub fn get_sampling_statistic_summaries( &self, ) -> GetSamplingStatisticSummariesFluentBuilder
Constructs a fluent builder for the GetSamplingStatisticSummaries
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetSamplingStatisticSummariesOutput
with field(s):sampling_statistic_summaries(Option<Vec::<SamplingStatisticSummary>>)
:Information about the number of requests instrumented for each sampling rule.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetSamplingStatisticSummariesError>
Source§impl Client
impl Client
Sourcepub fn get_sampling_targets(&self) -> GetSamplingTargetsFluentBuilder
pub fn get_sampling_targets(&self) -> GetSamplingTargetsFluentBuilder
Constructs a fluent builder for the GetSamplingTargets
operation.
- The fluent builder is configurable:
sampling_statistics_documents(SamplingStatisticsDocument)
/set_sampling_statistics_documents(Option<Vec::<SamplingStatisticsDocument>>)
:
required: trueInformation about rules that the service is using to sample requests.
- On success, responds with
GetSamplingTargetsOutput
with field(s):sampling_target_documents(Option<Vec::<SamplingTargetDocument>>)
:Updated rules that the service should use to sample requests.
last_rule_modification(Option<DateTime>)
:The last time a user changed the sampling rule configuration. If the sampling rule configuration changed since the service last retrieved it, the service should call GetSamplingRules to get the latest version.
unprocessed_statistics(Option<Vec::<UnprocessedStatistics>>)
:Information about SamplingStatisticsDocument that X-Ray could not process.
- On failure, responds with
SdkError<GetSamplingTargetsError>
Source§impl Client
impl Client
Sourcepub fn get_service_graph(&self) -> GetServiceGraphFluentBuilder
pub fn get_service_graph(&self) -> GetServiceGraphFluentBuilder
Constructs a fluent builder for the GetServiceGraph
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe start of the time frame for which to generate a graph.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe end of the timeframe for which to generate a graph.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe name of a group based on which you want to generate a graph.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of a group based on which you want to generate a graph.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetServiceGraphOutput
with field(s):start_time(Option<DateTime>)
:The start of the time frame for which the graph was generated.
end_time(Option<DateTime>)
:The end of the time frame for which the graph was generated.
services(Option<Vec::<Service>>)
:The services that have processed a traced request during the specified time frame.
contains_old_group_versions(bool)
:A flag indicating whether the group’s filter expression has been consistent, or if the returned service graph may show traces from an older version of the group’s filter expression.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetServiceGraphError>
Source§impl Client
impl Client
Sourcepub fn get_time_series_service_statistics(
&self,
) -> GetTimeSeriesServiceStatisticsFluentBuilder
pub fn get_time_series_service_statistics( &self, ) -> GetTimeSeriesServiceStatisticsFluentBuilder
Constructs a fluent builder for the GetTimeSeriesServiceStatistics
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe start of the time frame for which to aggregate statistics.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe end of the time frame for which to aggregate statistics.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe case-sensitive name of the group for which to pull statistics from.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the group for which to pull statistics from.
entity_selector_expression(impl Into<String>)
/set_entity_selector_expression(Option<String>)
:
required: falseA filter expression defining entities that will be aggregated for statistics. Supports ID, service, and edge functions. If no selector expression is specified, edge statistics are returned.
period(i32)
/set_period(Option<i32>)
:
required: falseAggregation period in seconds.
forecast_statistics(bool)
/set_forecast_statistics(Option<bool>)
:
required: falseThe forecasted high and low fault count values. Forecast enabled requests require the EntitySelectorExpression ID be provided.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetTimeSeriesServiceStatisticsOutput
with field(s):time_series_service_statistics(Option<Vec::<TimeSeriesServiceStatistics>>)
:The collection of statistics.
contains_old_group_versions(bool)
:A flag indicating whether or not a group’s filter expression has been consistent, or if a returned aggregation might show statistics from an older version of the group’s filter expression.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetTimeSeriesServiceStatisticsError>
Source§impl Client
impl Client
Sourcepub fn get_trace_graph(&self) -> GetTraceGraphFluentBuilder
pub fn get_trace_graph(&self) -> GetTraceGraphFluentBuilder
Constructs a fluent builder for the GetTraceGraph
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
trace_ids(impl Into<String>)
/set_trace_ids(Option<Vec::<String>>)
:
required: trueTrace IDs of requests for which to generate a service graph.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falsePagination token.
- On success, responds with
GetTraceGraphOutput
with field(s):services(Option<Vec::<Service>>)
:The services that have processed one of the specified requests.
next_token(Option<String>)
:Pagination token.
- On failure, responds with
SdkError<GetTraceGraphError>
Source§impl Client
impl Client
Sourcepub fn get_trace_segment_destination(
&self,
) -> GetTraceSegmentDestinationFluentBuilder
pub fn get_trace_segment_destination( &self, ) -> GetTraceSegmentDestinationFluentBuilder
Constructs a fluent builder for the GetTraceSegmentDestination
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetTraceSegmentDestinationOutput
with field(s):destination(Option<TraceSegmentDestination>)
:Retrieves the current destination.
status(Option<TraceSegmentDestinationStatus>)
:Status of the retrieval.
- On failure, responds with
SdkError<GetTraceSegmentDestinationError>
Source§impl Client
impl Client
Sourcepub fn get_trace_summaries(&self) -> GetTraceSummariesFluentBuilder
pub fn get_trace_summaries(&self) -> GetTraceSummariesFluentBuilder
Constructs a fluent builder for the GetTraceSummaries
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe start of the time frame for which to retrieve traces.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe end of the time frame for which to retrieve traces.
time_range_type(TimeRangeType)
/set_time_range_type(Option<TimeRangeType>)
:
required: falseQuery trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).
sampling(bool)
/set_sampling(Option<bool>)
:
required: falseSet to
true
to get summaries for only a subset of available traces.sampling_strategy(SamplingStrategy)
/set_sampling_strategy(Option<SamplingStrategy>)
:
required: falseA parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.
filter_expression(impl Into<String>)
/set_filter_expression(Option<String>)
:
required: falseSpecify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of results.
- On success, responds with
GetTraceSummariesOutput
with field(s):trace_summaries(Option<Vec::<TraceSummary>>)
:Trace IDs and annotations for traces that were found in the specified time frame.
approximate_time(Option<DateTime>)
:The start time of this page of results.
traces_processed_count(Option<i64>)
:The total number of traces processed, including traces that did not match the specified filter expression.
next_token(Option<String>)
:If the requested time frame contained more than one page of results, you can use this token to retrieve the next page. The first page contains the most recent results, closest to the end of the time frame.
- On failure, responds with
SdkError<GetTraceSummariesError>
Source§impl Client
impl Client
Sourcepub fn list_resource_policies(&self) -> ListResourcePoliciesFluentBuilder
pub fn list_resource_policies(&self) -> ListResourcePoliciesFluentBuilder
Constructs a fluent builder for the ListResourcePolicies
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseNot currently supported.
- On success, responds with
ListResourcePoliciesOutput
with field(s):resource_policies(Option<Vec::<ResourcePolicy>>)
:The list of resource policies in the target Amazon Web Services account.
next_token(Option<String>)
:Pagination token. Not currently supported.
- On failure, responds with
SdkError<ListResourcePoliciesError>
Source§impl Client
impl Client
Sourcepub fn list_retrieved_traces(&self) -> ListRetrievedTracesFluentBuilder
pub fn list_retrieved_traces(&self) -> ListRetrievedTracesFluentBuilder
Constructs a fluent builder for the ListRetrievedTraces
operation.
- The fluent builder is configurable:
retrieval_token(impl Into<String>)
/set_retrieval_token(Option<String>)
:
required: trueRetrieval token.
trace_format(TraceFormatType)
/set_trace_format(Option<TraceFormatType>)
:
required: falseFormat of the requested traces.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseSpecify the pagination token returned by a previous request to retrieve the next page of indexes.
- On success, responds with
ListRetrievedTracesOutput
with field(s):retrieval_status(Option<RetrievalStatus>)
:Status of the retrieval.
trace_format(Option<TraceFormatType>)
:Format of the requested traces.
traces(Option<Vec::<RetrievedTrace>>)
:Full traces for the specified requests.
next_token(Option<String>)
:Specify the pagination token returned by a previous request to retrieve the next page of indexes.
- On failure, responds with
SdkError<ListRetrievedTracesError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA pagination token. If multiple pages of results are returned, use the
NextToken
value returned with the current page of results as the value of this parameter to get the next page of results.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:A list of tags, as key and value pairs, that is associated with the specified X-Ray group or sampling rule.
next_token(Option<String>)
:A pagination token. If multiple pages of results are returned, use the
NextToken
value returned with the current page of results to get the next page of results.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn put_encryption_config(&self) -> PutEncryptionConfigFluentBuilder
pub fn put_encryption_config(&self) -> PutEncryptionConfigFluentBuilder
Constructs a fluent builder for the PutEncryptionConfig
operation.
- The fluent builder is configurable:
key_id(impl Into<String>)
/set_key_id(Option<String>)
:
required: falseAn Amazon Web Services KMS key in one of the following formats:
-
Alias - The name of the key. For example,
alias/MyKey
. -
Key ID - The KMS key ID of the key. For example,
ae4aa6d49-a4d8-9df9-a475-4ff6d7898456
. Amazon Web Services X-Ray does not support asymmetric KMS keys. -
ARN - The full Amazon Resource Name of the key ID or alias. For example,
arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456
. Use this format to specify a key in a different account.
Omit this key if you set
Type
toNONE
.-
r#type(EncryptionType)
/set_type(Option<EncryptionType>)
:
required: trueThe type of encryption. Set to
KMS
to use your own key for encryption. Set toNONE
for default encryption.
- On success, responds with
PutEncryptionConfigOutput
with field(s):encryption_config(Option<EncryptionConfig>)
:The new encryption configuration.
- On failure, responds with
SdkError<PutEncryptionConfigError>
Source§impl Client
impl Client
Sourcepub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder
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: trueThe name of the resource policy. Must be unique within a specific Amazon Web Services account.
policy_document(impl Into<String>)
/set_policy_document(Option<String>)
:
required: trueThe resource policy document, which can be up to 5kb in size.
policy_revision_id(impl Into<String>)
/set_policy_revision_id(Option<String>)
:
required: falseSpecifies a specific policy revision, to ensure an atomic create operation. By default the resource policy is created if it does not exist, or updated with an incremented revision id. The revision id is unique to each policy in the account.
If the policy revision id does not match the latest revision id, the operation will fail with an
InvalidPolicyRevisionIdException
exception. You can also provide aPolicyRevisionId
of 0. In this case, the operation will fail with anInvalidPolicyRevisionIdException
exception if a resource policy with the same name already exists.bypass_policy_lockout_check(bool)
/set_bypass_policy_lockout_check(Option<bool>)
:
required: falseA flag to indicate whether to bypass the resource policy lockout safety check.
Setting this value to true increases the risk that the policy becomes unmanageable. Do not set this value to true indiscriminately.
Use this parameter only when you include a policy in the request and you intend to prevent the principal that is making the request from making a subsequent
PutResourcePolicy
request.The default value is false.
- On success, responds with
PutResourcePolicyOutput
with field(s):resource_policy(Option<ResourcePolicy>)
:The resource policy document, as provided in the
PutResourcePolicyRequest
.
- On failure, responds with
SdkError<PutResourcePolicyError>
Source§impl Client
impl Client
Sourcepub fn put_telemetry_records(&self) -> PutTelemetryRecordsFluentBuilder
pub fn put_telemetry_records(&self) -> PutTelemetryRecordsFluentBuilder
Constructs a fluent builder for the PutTelemetryRecords
operation.
- The fluent builder is configurable:
telemetry_records(TelemetryRecord)
/set_telemetry_records(Option<Vec::<TelemetryRecord>>)
:
required: trueec2_instance_id(impl Into<String>)
/set_ec2_instance_id(Option<String>)
:
required: falsehostname(impl Into<String>)
/set_hostname(Option<String>)
:
required: falseresource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: false
- On success, responds with
PutTelemetryRecordsOutput
- On failure, responds with
SdkError<PutTelemetryRecordsError>
Source§impl Client
impl Client
Sourcepub fn put_trace_segments(&self) -> PutTraceSegmentsFluentBuilder
pub fn put_trace_segments(&self) -> PutTraceSegmentsFluentBuilder
Constructs a fluent builder for the PutTraceSegments
operation.
- The fluent builder is configurable:
trace_segment_documents(impl Into<String>)
/set_trace_segment_documents(Option<Vec::<String>>)
:
required: trueA string containing a JSON document defining one or more segments or subsegments.
- On success, responds with
PutTraceSegmentsOutput
with field(s):unprocessed_trace_segments(Option<Vec::<UnprocessedTraceSegment>>)
:Segments that failed processing.
- On failure, responds with
SdkError<PutTraceSegmentsError>
Source§impl Client
impl Client
Sourcepub fn start_trace_retrieval(&self) -> StartTraceRetrievalFluentBuilder
pub fn start_trace_retrieval(&self) -> StartTraceRetrievalFluentBuilder
Constructs a fluent builder for the StartTraceRetrieval
operation.
- The fluent builder is configurable:
trace_ids(impl Into<String>)
/set_trace_ids(Option<Vec::<String>>)
:
required: trueSpecify the trace IDs of the traces to be retrieved.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:
required: trueThe start of the time range to retrieve traces. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:
required: trueThe end of the time range to retrieve traces. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
- On success, responds with
StartTraceRetrievalOutput
with field(s):retrieval_token(Option<String>)
:Retrieval token.
- On failure, responds with
SdkError<StartTraceRetrievalError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueA map that contains one or more tag keys and tag values to attach to an X-Ray group or sampling rule. For more information about ways to use tags, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference.
The following restrictions apply to tags:
-
Maximum number of user-applied tags per resource: 50
-
Maximum tag key length: 128 Unicode characters
-
Maximum tag value length: 256 Unicode characters
-
Valid values for key and value: a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @
-
Tag keys and values are case sensitive.
-
Don’t use
aws:
as a prefix for keys; it’s reserved for Amazon Web Services use. You cannot edit or delete system tags.
-
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Number (ARN) of an X-Ray group or sampling rule.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueKeys for one or more tags that you want to remove from an X-Ray group or sampling rule.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_group(&self) -> UpdateGroupFluentBuilder
pub fn update_group(&self) -> UpdateGroupFluentBuilder
Constructs a fluent builder for the UpdateGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:
required: falseThe case-sensitive name of the group.
group_arn(impl Into<String>)
/set_group_arn(Option<String>)
:
required: falseThe ARN that was generated upon creation.
filter_expression(impl Into<String>)
/set_filter_expression(Option<String>)
:
required: falseThe updated filter expression defining criteria by which to group traces.
insights_configuration(InsightsConfiguration)
/set_insights_configuration(Option<InsightsConfiguration>)
:
required: falseThe structure containing configurations related to insights.
-
The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.
-
The NotificationsEnabled boolean can be set to true to enable insights notifications for the group. Notifications can only be enabled on a group with InsightsEnabled set to true.
-
- On success, responds with
UpdateGroupOutput
with field(s):group(Option<Group>)
:The group that was updated. Contains the name of the group that was updated, the ARN of the group that was updated, the updated filter expression, and the updated insight configuration assigned to the group.
- On failure, responds with
SdkError<UpdateGroupError>
Source§impl Client
impl Client
Sourcepub fn update_indexing_rule(&self) -> UpdateIndexingRuleFluentBuilder
pub fn update_indexing_rule(&self) -> UpdateIndexingRuleFluentBuilder
Constructs a fluent builder for the UpdateIndexingRule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueName of the indexing rule to be updated.
rule(IndexingRuleValueUpdate)
/set_rule(Option<IndexingRuleValueUpdate>)
:
required: trueRule configuration to be updated.
- On success, responds with
UpdateIndexingRuleOutput
with field(s):indexing_rule(Option<IndexingRule>)
:Updated indexing rule.
- On failure, responds with
SdkError<UpdateIndexingRuleError>
Source§impl Client
impl Client
Sourcepub fn update_sampling_rule(&self) -> UpdateSamplingRuleFluentBuilder
pub fn update_sampling_rule(&self) -> UpdateSamplingRuleFluentBuilder
Constructs a fluent builder for the UpdateSamplingRule
operation.
- The fluent builder is configurable:
sampling_rule_update(SamplingRuleUpdate)
/set_sampling_rule_update(Option<SamplingRuleUpdate>)
:
required: trueThe rule and fields to change.
- On success, responds with
UpdateSamplingRuleOutput
with field(s):sampling_rule_record(Option<SamplingRuleRecord>)
:The updated rule definition and metadata.
- On failure, responds with
SdkError<UpdateSamplingRuleError>
Source§impl Client
impl Client
Sourcepub fn update_trace_segment_destination(
&self,
) -> UpdateTraceSegmentDestinationFluentBuilder
pub fn update_trace_segment_destination( &self, ) -> UpdateTraceSegmentDestinationFluentBuilder
Constructs a fluent builder for the UpdateTraceSegmentDestination
operation.
- The fluent builder is configurable:
destination(TraceSegmentDestination)
/set_destination(Option<TraceSegmentDestination>)
:
required: falseThe configured destination of trace segments.
- On success, responds with
UpdateTraceSegmentDestinationOutput
with field(s):destination(Option<TraceSegmentDestination>)
:The destination of the trace segments.
status(Option<TraceSegmentDestinationStatus>)
:The status of the update.
- On failure, responds with
SdkError<UpdateTraceSegmentDestinationError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
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
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
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 thesleep_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 thehttp_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, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
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> 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> 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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
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>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
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>
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>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
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>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
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>
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>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
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>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
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>
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>
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>
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>
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>
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>
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 underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
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);