#[non_exhaustive]pub enum Error {
InvalidPolicyRevisionIdException(InvalidPolicyRevisionIdException),
InvalidRequestException(InvalidRequestException),
LockoutPreventionException(LockoutPreventionException),
MalformedPolicyDocumentException(MalformedPolicyDocumentException),
PolicyCountLimitExceededException(PolicyCountLimitExceededException),
PolicySizeLimitExceededException(PolicySizeLimitExceededException),
ResourceNotFoundException(ResourceNotFoundException),
RuleLimitExceededException(RuleLimitExceededException),
ThrottledException(ThrottledException),
TooManyTagsException(TooManyTagsException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPolicyRevisionIdException(InvalidPolicyRevisionIdException)
A policy revision id was provided which does not match the latest policy revision. This exception is also if a policy revision id of 0 is provided via PutResourcePolicy
and a policy with the same name already exists.
InvalidRequestException(InvalidRequestException)
The request is missing required parameters or has invalid parameters.
LockoutPreventionException(LockoutPreventionException)
The provided resource policy would prevent the caller of this request from calling PutResourcePolicy in the future.
MalformedPolicyDocumentException(MalformedPolicyDocumentException)
Invalid policy document provided in request.
PolicyCountLimitExceededException(PolicyCountLimitExceededException)
Exceeded the maximum number of resource policies for a target Amazon Web Services account.
PolicySizeLimitExceededException(PolicySizeLimitExceededException)
Exceeded the maximum size for a resource policy.
ResourceNotFoundException(ResourceNotFoundException)
The resource was not found. Verify that the name or Amazon Resource Name (ARN) of the resource is correct.
RuleLimitExceededException(RuleLimitExceededException)
You have reached the maximum number of sampling rules.
ThrottledException(ThrottledException)
The request exceeds the maximum number of requests per second.
TooManyTagsException(TooManyTagsException)
You have exceeded the maximum number of tags you can apply to this resource.
Unhandled(Unhandled)
Unhandled
directly is not forwards compatible. Instead, match using a variable wildcard pattern and check .code()
:
err if err.code() == Some("SpecificExceptionCode") => { /* handle the error */ }
See ProvideErrorMetadata
for what information is available for the error.An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<BatchGetTracesError> for Error
impl From<BatchGetTracesError> for Error
Source§fn from(err: BatchGetTracesError) -> Self
fn from(err: BatchGetTracesError) -> Self
Source§impl From<BuildError> for Error
impl From<BuildError> for Error
Source§fn from(value: BuildError) -> Self
fn from(value: BuildError) -> Self
Source§impl From<CancelTraceRetrievalError> for Error
impl From<CancelTraceRetrievalError> for Error
Source§fn from(err: CancelTraceRetrievalError) -> Self
fn from(err: CancelTraceRetrievalError) -> Self
Source§impl From<CreateGroupError> for Error
impl From<CreateGroupError> for Error
Source§fn from(err: CreateGroupError) -> Self
fn from(err: CreateGroupError) -> Self
Source§impl From<CreateSamplingRuleError> for Error
impl From<CreateSamplingRuleError> for Error
Source§fn from(err: CreateSamplingRuleError) -> Self
fn from(err: CreateSamplingRuleError) -> Self
Source§impl From<DeleteGroupError> for Error
impl From<DeleteGroupError> for Error
Source§fn from(err: DeleteGroupError) -> Self
fn from(err: DeleteGroupError) -> Self
Source§impl From<DeleteResourcePolicyError> for Error
impl From<DeleteResourcePolicyError> for Error
Source§fn from(err: DeleteResourcePolicyError) -> Self
fn from(err: DeleteResourcePolicyError) -> Self
Source§impl From<DeleteSamplingRuleError> for Error
impl From<DeleteSamplingRuleError> for Error
Source§fn from(err: DeleteSamplingRuleError) -> Self
fn from(err: DeleteSamplingRuleError) -> Self
Source§impl From<GetEncryptionConfigError> for Error
impl From<GetEncryptionConfigError> for Error
Source§fn from(err: GetEncryptionConfigError) -> Self
fn from(err: GetEncryptionConfigError) -> Self
Source§impl From<GetGroupError> for Error
impl From<GetGroupError> for Error
Source§fn from(err: GetGroupError) -> Self
fn from(err: GetGroupError) -> Self
Source§impl From<GetGroupsError> for Error
impl From<GetGroupsError> for Error
Source§fn from(err: GetGroupsError) -> Self
fn from(err: GetGroupsError) -> Self
Source§impl From<GetIndexingRulesError> for Error
impl From<GetIndexingRulesError> for Error
Source§fn from(err: GetIndexingRulesError) -> Self
fn from(err: GetIndexingRulesError) -> Self
Source§impl From<GetInsightError> for Error
impl From<GetInsightError> for Error
Source§fn from(err: GetInsightError) -> Self
fn from(err: GetInsightError) -> Self
Source§impl From<GetInsightEventsError> for Error
impl From<GetInsightEventsError> for Error
Source§fn from(err: GetInsightEventsError) -> Self
fn from(err: GetInsightEventsError) -> Self
Source§impl From<GetInsightImpactGraphError> for Error
impl From<GetInsightImpactGraphError> for Error
Source§fn from(err: GetInsightImpactGraphError) -> Self
fn from(err: GetInsightImpactGraphError) -> Self
Source§impl From<GetInsightSummariesError> for Error
impl From<GetInsightSummariesError> for Error
Source§fn from(err: GetInsightSummariesError) -> Self
fn from(err: GetInsightSummariesError) -> Self
Source§impl From<GetRetrievedTracesGraphError> for Error
impl From<GetRetrievedTracesGraphError> for Error
Source§fn from(err: GetRetrievedTracesGraphError) -> Self
fn from(err: GetRetrievedTracesGraphError) -> Self
Source§impl From<GetSamplingRulesError> for Error
impl From<GetSamplingRulesError> for Error
Source§fn from(err: GetSamplingRulesError) -> Self
fn from(err: GetSamplingRulesError) -> Self
Source§impl From<GetSamplingStatisticSummariesError> for Error
impl From<GetSamplingStatisticSummariesError> for Error
Source§fn from(err: GetSamplingStatisticSummariesError) -> Self
fn from(err: GetSamplingStatisticSummariesError) -> Self
Source§impl From<GetSamplingTargetsError> for Error
impl From<GetSamplingTargetsError> for Error
Source§fn from(err: GetSamplingTargetsError) -> Self
fn from(err: GetSamplingTargetsError) -> Self
Source§impl From<GetServiceGraphError> for Error
impl From<GetServiceGraphError> for Error
Source§fn from(err: GetServiceGraphError) -> Self
fn from(err: GetServiceGraphError) -> Self
Source§impl From<GetTimeSeriesServiceStatisticsError> for Error
impl From<GetTimeSeriesServiceStatisticsError> for Error
Source§fn from(err: GetTimeSeriesServiceStatisticsError) -> Self
fn from(err: GetTimeSeriesServiceStatisticsError) -> Self
Source§impl From<GetTraceGraphError> for Error
impl From<GetTraceGraphError> for Error
Source§fn from(err: GetTraceGraphError) -> Self
fn from(err: GetTraceGraphError) -> Self
Source§impl From<GetTraceSegmentDestinationError> for Error
impl From<GetTraceSegmentDestinationError> for Error
Source§fn from(err: GetTraceSegmentDestinationError) -> Self
fn from(err: GetTraceSegmentDestinationError) -> Self
Source§impl From<GetTraceSummariesError> for Error
impl From<GetTraceSummariesError> for Error
Source§fn from(err: GetTraceSummariesError) -> Self
fn from(err: GetTraceSummariesError) -> Self
Source§impl From<ListResourcePoliciesError> for Error
impl From<ListResourcePoliciesError> for Error
Source§fn from(err: ListResourcePoliciesError) -> Self
fn from(err: ListResourcePoliciesError) -> Self
Source§impl From<ListRetrievedTracesError> for Error
impl From<ListRetrievedTracesError> for Error
Source§fn from(err: ListRetrievedTracesError) -> Self
fn from(err: ListRetrievedTracesError) -> Self
Source§impl From<ListTagsForResourceError> for Error
impl From<ListTagsForResourceError> for Error
Source§fn from(err: ListTagsForResourceError) -> Self
fn from(err: ListTagsForResourceError) -> Self
Source§impl From<PutEncryptionConfigError> for Error
impl From<PutEncryptionConfigError> for Error
Source§fn from(err: PutEncryptionConfigError) -> Self
fn from(err: PutEncryptionConfigError) -> Self
Source§impl From<PutResourcePolicyError> for Error
impl From<PutResourcePolicyError> for Error
Source§fn from(err: PutResourcePolicyError) -> Self
fn from(err: PutResourcePolicyError) -> Self
Source§impl From<PutTelemetryRecordsError> for Error
impl From<PutTelemetryRecordsError> for Error
Source§fn from(err: PutTelemetryRecordsError) -> Self
fn from(err: PutTelemetryRecordsError) -> Self
Source§impl From<PutTraceSegmentsError> for Error
impl From<PutTraceSegmentsError> for Error
Source§fn from(err: PutTraceSegmentsError) -> Self
fn from(err: PutTraceSegmentsError) -> Self
Source§impl<R> From<SdkError<BatchGetTracesError, R>> for Error
impl<R> From<SdkError<BatchGetTracesError, R>> for Error
Source§fn from(err: SdkError<BatchGetTracesError, R>) -> Self
fn from(err: SdkError<BatchGetTracesError, R>) -> Self
Source§impl<R> From<SdkError<CancelTraceRetrievalError, R>> for Error
impl<R> From<SdkError<CancelTraceRetrievalError, R>> for Error
Source§fn from(err: SdkError<CancelTraceRetrievalError, R>) -> Self
fn from(err: SdkError<CancelTraceRetrievalError, R>) -> Self
Source§impl<R> From<SdkError<CreateGroupError, R>> for Error
impl<R> From<SdkError<CreateGroupError, R>> for Error
Source§fn from(err: SdkError<CreateGroupError, R>) -> Self
fn from(err: SdkError<CreateGroupError, R>) -> Self
Source§impl<R> From<SdkError<CreateSamplingRuleError, R>> for Error
impl<R> From<SdkError<CreateSamplingRuleError, R>> for Error
Source§fn from(err: SdkError<CreateSamplingRuleError, R>) -> Self
fn from(err: SdkError<CreateSamplingRuleError, R>) -> Self
Source§impl<R> From<SdkError<DeleteGroupError, R>> for Error
impl<R> From<SdkError<DeleteGroupError, R>> for Error
Source§fn from(err: SdkError<DeleteGroupError, R>) -> Self
fn from(err: SdkError<DeleteGroupError, R>) -> Self
Source§impl<R> From<SdkError<DeleteResourcePolicyError, R>> for Error
impl<R> From<SdkError<DeleteResourcePolicyError, R>> for Error
Source§fn from(err: SdkError<DeleteResourcePolicyError, R>) -> Self
fn from(err: SdkError<DeleteResourcePolicyError, R>) -> Self
Source§impl<R> From<SdkError<DeleteSamplingRuleError, R>> for Error
impl<R> From<SdkError<DeleteSamplingRuleError, R>> for Error
Source§fn from(err: SdkError<DeleteSamplingRuleError, R>) -> Self
fn from(err: SdkError<DeleteSamplingRuleError, R>) -> Self
Source§impl<R> From<SdkError<GetEncryptionConfigError, R>> for Error
impl<R> From<SdkError<GetEncryptionConfigError, R>> for Error
Source§fn from(err: SdkError<GetEncryptionConfigError, R>) -> Self
fn from(err: SdkError<GetEncryptionConfigError, R>) -> Self
Source§impl<R> From<SdkError<GetGroupError, R>> for Error
impl<R> From<SdkError<GetGroupError, R>> for Error
Source§fn from(err: SdkError<GetGroupError, R>) -> Self
fn from(err: SdkError<GetGroupError, R>) -> Self
Source§impl<R> From<SdkError<GetGroupsError, R>> for Error
impl<R> From<SdkError<GetGroupsError, R>> for Error
Source§fn from(err: SdkError<GetGroupsError, R>) -> Self
fn from(err: SdkError<GetGroupsError, R>) -> Self
Source§impl<R> From<SdkError<GetIndexingRulesError, R>> for Error
impl<R> From<SdkError<GetIndexingRulesError, R>> for Error
Source§fn from(err: SdkError<GetIndexingRulesError, R>) -> Self
fn from(err: SdkError<GetIndexingRulesError, R>) -> Self
Source§impl<R> From<SdkError<GetInsightError, R>> for Error
impl<R> From<SdkError<GetInsightError, R>> for Error
Source§fn from(err: SdkError<GetInsightError, R>) -> Self
fn from(err: SdkError<GetInsightError, R>) -> Self
Source§impl<R> From<SdkError<GetInsightEventsError, R>> for Error
impl<R> From<SdkError<GetInsightEventsError, R>> for Error
Source§fn from(err: SdkError<GetInsightEventsError, R>) -> Self
fn from(err: SdkError<GetInsightEventsError, R>) -> Self
Source§impl<R> From<SdkError<GetInsightImpactGraphError, R>> for Error
impl<R> From<SdkError<GetInsightImpactGraphError, R>> for Error
Source§fn from(err: SdkError<GetInsightImpactGraphError, R>) -> Self
fn from(err: SdkError<GetInsightImpactGraphError, R>) -> Self
Source§impl<R> From<SdkError<GetInsightSummariesError, R>> for Error
impl<R> From<SdkError<GetInsightSummariesError, R>> for Error
Source§fn from(err: SdkError<GetInsightSummariesError, R>) -> Self
fn from(err: SdkError<GetInsightSummariesError, R>) -> Self
Source§impl<R> From<SdkError<GetRetrievedTracesGraphError, R>> for Error
impl<R> From<SdkError<GetRetrievedTracesGraphError, R>> for Error
Source§fn from(err: SdkError<GetRetrievedTracesGraphError, R>) -> Self
fn from(err: SdkError<GetRetrievedTracesGraphError, R>) -> Self
Source§impl<R> From<SdkError<GetSamplingRulesError, R>> for Error
impl<R> From<SdkError<GetSamplingRulesError, R>> for Error
Source§fn from(err: SdkError<GetSamplingRulesError, R>) -> Self
fn from(err: SdkError<GetSamplingRulesError, R>) -> Self
Source§impl<R> From<SdkError<GetSamplingStatisticSummariesError, R>> for Error
impl<R> From<SdkError<GetSamplingStatisticSummariesError, R>> for Error
Source§fn from(err: SdkError<GetSamplingStatisticSummariesError, R>) -> Self
fn from(err: SdkError<GetSamplingStatisticSummariesError, R>) -> Self
Source§impl<R> From<SdkError<GetSamplingTargetsError, R>> for Error
impl<R> From<SdkError<GetSamplingTargetsError, R>> for Error
Source§fn from(err: SdkError<GetSamplingTargetsError, R>) -> Self
fn from(err: SdkError<GetSamplingTargetsError, R>) -> Self
Source§impl<R> From<SdkError<GetServiceGraphError, R>> for Error
impl<R> From<SdkError<GetServiceGraphError, R>> for Error
Source§fn from(err: SdkError<GetServiceGraphError, R>) -> Self
fn from(err: SdkError<GetServiceGraphError, R>) -> Self
Source§impl<R> From<SdkError<GetTimeSeriesServiceStatisticsError, R>> for Error
impl<R> From<SdkError<GetTimeSeriesServiceStatisticsError, R>> for Error
Source§fn from(err: SdkError<GetTimeSeriesServiceStatisticsError, R>) -> Self
fn from(err: SdkError<GetTimeSeriesServiceStatisticsError, R>) -> Self
Source§impl<R> From<SdkError<GetTraceGraphError, R>> for Error
impl<R> From<SdkError<GetTraceGraphError, R>> for Error
Source§fn from(err: SdkError<GetTraceGraphError, R>) -> Self
fn from(err: SdkError<GetTraceGraphError, R>) -> Self
Source§impl<R> From<SdkError<GetTraceSegmentDestinationError, R>> for Error
impl<R> From<SdkError<GetTraceSegmentDestinationError, R>> for Error
Source§fn from(err: SdkError<GetTraceSegmentDestinationError, R>) -> Self
fn from(err: SdkError<GetTraceSegmentDestinationError, R>) -> Self
Source§impl<R> From<SdkError<GetTraceSummariesError, R>> for Error
impl<R> From<SdkError<GetTraceSummariesError, R>> for Error
Source§fn from(err: SdkError<GetTraceSummariesError, R>) -> Self
fn from(err: SdkError<GetTraceSummariesError, R>) -> Self
Source§impl<R> From<SdkError<ListResourcePoliciesError, R>> for Error
impl<R> From<SdkError<ListResourcePoliciesError, R>> for Error
Source§fn from(err: SdkError<ListResourcePoliciesError, R>) -> Self
fn from(err: SdkError<ListResourcePoliciesError, R>) -> Self
Source§impl<R> From<SdkError<ListRetrievedTracesError, R>> for Error
impl<R> From<SdkError<ListRetrievedTracesError, R>> for Error
Source§fn from(err: SdkError<ListRetrievedTracesError, R>) -> Self
fn from(err: SdkError<ListRetrievedTracesError, R>) -> Self
Source§impl<R> From<SdkError<ListTagsForResourceError, R>> for Error
impl<R> From<SdkError<ListTagsForResourceError, R>> for Error
Source§fn from(err: SdkError<ListTagsForResourceError, R>) -> Self
fn from(err: SdkError<ListTagsForResourceError, R>) -> Self
Source§impl<R> From<SdkError<PutEncryptionConfigError, R>> for Error
impl<R> From<SdkError<PutEncryptionConfigError, R>> for Error
Source§fn from(err: SdkError<PutEncryptionConfigError, R>) -> Self
fn from(err: SdkError<PutEncryptionConfigError, R>) -> Self
Source§impl<R> From<SdkError<PutResourcePolicyError, R>> for Error
impl<R> From<SdkError<PutResourcePolicyError, R>> for Error
Source§fn from(err: SdkError<PutResourcePolicyError, R>) -> Self
fn from(err: SdkError<PutResourcePolicyError, R>) -> Self
Source§impl<R> From<SdkError<PutTelemetryRecordsError, R>> for Error
impl<R> From<SdkError<PutTelemetryRecordsError, R>> for Error
Source§fn from(err: SdkError<PutTelemetryRecordsError, R>) -> Self
fn from(err: SdkError<PutTelemetryRecordsError, R>) -> Self
Source§impl<R> From<SdkError<PutTraceSegmentsError, R>> for Error
impl<R> From<SdkError<PutTraceSegmentsError, R>> for Error
Source§fn from(err: SdkError<PutTraceSegmentsError, R>) -> Self
fn from(err: SdkError<PutTraceSegmentsError, R>) -> Self
Source§impl<R> From<SdkError<StartTraceRetrievalError, R>> for Error
impl<R> From<SdkError<StartTraceRetrievalError, R>> for Error
Source§fn from(err: SdkError<StartTraceRetrievalError, R>) -> Self
fn from(err: SdkError<StartTraceRetrievalError, R>) -> Self
Source§impl<R> From<SdkError<TagResourceError, R>> for Error
impl<R> From<SdkError<TagResourceError, R>> for Error
Source§fn from(err: SdkError<TagResourceError, R>) -> Self
fn from(err: SdkError<TagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UntagResourceError, R>> for Error
impl<R> From<SdkError<UntagResourceError, R>> for Error
Source§fn from(err: SdkError<UntagResourceError, R>) -> Self
fn from(err: SdkError<UntagResourceError, R>) -> Self
Source§impl<R> From<SdkError<UpdateGroupError, R>> for Error
impl<R> From<SdkError<UpdateGroupError, R>> for Error
Source§fn from(err: SdkError<UpdateGroupError, R>) -> Self
fn from(err: SdkError<UpdateGroupError, R>) -> Self
Source§impl<R> From<SdkError<UpdateIndexingRuleError, R>> for Error
impl<R> From<SdkError<UpdateIndexingRuleError, R>> for Error
Source§fn from(err: SdkError<UpdateIndexingRuleError, R>) -> Self
fn from(err: SdkError<UpdateIndexingRuleError, R>) -> Self
Source§impl<R> From<SdkError<UpdateSamplingRuleError, R>> for Error
impl<R> From<SdkError<UpdateSamplingRuleError, R>> for Error
Source§fn from(err: SdkError<UpdateSamplingRuleError, R>) -> Self
fn from(err: SdkError<UpdateSamplingRuleError, R>) -> Self
Source§impl<R> From<SdkError<UpdateTraceSegmentDestinationError, R>> for Error
impl<R> From<SdkError<UpdateTraceSegmentDestinationError, R>> for Error
Source§fn from(err: SdkError<UpdateTraceSegmentDestinationError, R>) -> Self
fn from(err: SdkError<UpdateTraceSegmentDestinationError, R>) -> Self
Source§impl From<StartTraceRetrievalError> for Error
impl From<StartTraceRetrievalError> for Error
Source§fn from(err: StartTraceRetrievalError) -> Self
fn from(err: StartTraceRetrievalError) -> Self
Source§impl From<TagResourceError> for Error
impl From<TagResourceError> for Error
Source§fn from(err: TagResourceError) -> Self
fn from(err: TagResourceError) -> Self
Source§impl From<UntagResourceError> for Error
impl From<UntagResourceError> for Error
Source§fn from(err: UntagResourceError) -> Self
fn from(err: UntagResourceError) -> Self
Source§impl From<UpdateGroupError> for Error
impl From<UpdateGroupError> for Error
Source§fn from(err: UpdateGroupError) -> Self
fn from(err: UpdateGroupError) -> Self
Source§impl From<UpdateIndexingRuleError> for Error
impl From<UpdateIndexingRuleError> for Error
Source§fn from(err: UpdateIndexingRuleError) -> Self
fn from(err: UpdateIndexingRuleError) -> Self
Source§impl From<UpdateSamplingRuleError> for Error
impl From<UpdateSamplingRuleError> for Error
Source§fn from(err: UpdateSamplingRuleError) -> Self
fn from(err: UpdateSamplingRuleError) -> Self
Source§impl From<UpdateTraceSegmentDestinationError> for Error
impl From<UpdateTraceSegmentDestinationError> for Error
Source§fn from(err: UpdateTraceSegmentDestinationError) -> Self
fn from(err: UpdateTraceSegmentDestinationError) -> Self
Source§impl ProvideErrorMetadata for Error
impl ProvideErrorMetadata for Error
Source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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> 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);