#[non_exhaustive]pub enum Error {
Show 14 variants
AccessDeniedException(AccessDeniedException),
AccessDeniedForDependencyException(AccessDeniedForDependencyException),
InternalErrorException(InternalErrorException),
InvalidOperationException(InvalidOperationException),
InvalidPaginationTokenException(InvalidPaginationTokenException),
InvalidParameterException(InvalidParameterException),
InvalidResourceException(InvalidResourceException),
LimitsExceededException(LimitsExceededException),
LockedSubscriptionException(LockedSubscriptionException),
NoAssociatedRoleException(NoAssociatedRoleException),
OptimisticLockException(OptimisticLockException),
ResourceAlreadyExistsException(ResourceAlreadyExistsException),
ResourceNotFoundException(ResourceNotFoundException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
Exception that indicates the specified AttackId
does not exist, or the requester does not have the appropriate permissions to access the AttackId
.
AccessDeniedForDependencyException(AccessDeniedForDependencyException)
In order to grant the necessary access to the Shield Response Team (SRT) the user submitting the request must have the iam:PassRole
permission. This error indicates the user did not have the appropriate permissions. For more information, see Granting a User Permissions to Pass a Role to an Amazon Web Services Service.
InternalErrorException(InternalErrorException)
Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.
InvalidOperationException(InvalidOperationException)
Exception that indicates that the operation would not cause any change to occur.
InvalidPaginationTokenException(InvalidPaginationTokenException)
Exception that indicates that the NextToken
specified in the request is invalid. Submit the request using the NextToken
value that was returned in the prior response.
InvalidParameterException(InvalidParameterException)
Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.
InvalidResourceException(InvalidResourceException)
Exception that indicates that the resource is invalid. You might not have access to the resource, or the resource might not exist.
LimitsExceededException(LimitsExceededException)
Exception that indicates that the operation would exceed a limit.
LockedSubscriptionException(LockedSubscriptionException)
You are trying to update a subscription that has not yet completed the 1-year commitment. You can change the AutoRenew
parameter during the last 30 days of your subscription. This exception indicates that you are attempting to change AutoRenew
prior to that period.
NoAssociatedRoleException(NoAssociatedRoleException)
The ARN of the role that you specified does not exist.
OptimisticLockException(OptimisticLockException)
Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.
ResourceAlreadyExistsException(ResourceAlreadyExistsException)
Exception indicating the specified resource already exists. If available, this exception includes details in additional properties.
ResourceNotFoundException(ResourceNotFoundException)
Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.
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<AssociateDRTLogBucketError> for Error
impl From<AssociateDRTLogBucketError> for Error
Source§fn from(err: AssociateDRTLogBucketError) -> Self
fn from(err: AssociateDRTLogBucketError) -> Self
Source§impl From<AssociateDRTRoleError> for Error
impl From<AssociateDRTRoleError> for Error
Source§fn from(err: AssociateDRTRoleError) -> Self
fn from(err: AssociateDRTRoleError) -> Self
Source§impl From<AssociateHealthCheckError> for Error
impl From<AssociateHealthCheckError> for Error
Source§fn from(err: AssociateHealthCheckError) -> Self
fn from(err: AssociateHealthCheckError) -> Self
Source§impl From<AssociateProactiveEngagementDetailsError> for Error
impl From<AssociateProactiveEngagementDetailsError> for Error
Source§fn from(err: AssociateProactiveEngagementDetailsError) -> Self
fn from(err: AssociateProactiveEngagementDetailsError) -> 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<CreateProtectionError> for Error
impl From<CreateProtectionError> for Error
Source§fn from(err: CreateProtectionError) -> Self
fn from(err: CreateProtectionError) -> Self
Source§impl From<CreateProtectionGroupError> for Error
impl From<CreateProtectionGroupError> for Error
Source§fn from(err: CreateProtectionGroupError) -> Self
fn from(err: CreateProtectionGroupError) -> Self
Source§impl From<CreateSubscriptionError> for Error
impl From<CreateSubscriptionError> for Error
Source§fn from(err: CreateSubscriptionError) -> Self
fn from(err: CreateSubscriptionError) -> Self
Source§impl From<DeleteProtectionError> for Error
impl From<DeleteProtectionError> for Error
Source§fn from(err: DeleteProtectionError) -> Self
fn from(err: DeleteProtectionError) -> Self
Source§impl From<DeleteProtectionGroupError> for Error
impl From<DeleteProtectionGroupError> for Error
Source§fn from(err: DeleteProtectionGroupError) -> Self
fn from(err: DeleteProtectionGroupError) -> Self
Source§impl From<DeleteSubscriptionError> for Error
impl From<DeleteSubscriptionError> for Error
Source§fn from(err: DeleteSubscriptionError) -> Self
fn from(err: DeleteSubscriptionError) -> Self
Source§impl From<DescribeAttackError> for Error
impl From<DescribeAttackError> for Error
Source§fn from(err: DescribeAttackError) -> Self
fn from(err: DescribeAttackError) -> Self
Source§impl From<DescribeAttackStatisticsError> for Error
impl From<DescribeAttackStatisticsError> for Error
Source§fn from(err: DescribeAttackStatisticsError) -> Self
fn from(err: DescribeAttackStatisticsError) -> Self
Source§impl From<DescribeDRTAccessError> for Error
impl From<DescribeDRTAccessError> for Error
Source§fn from(err: DescribeDRTAccessError) -> Self
fn from(err: DescribeDRTAccessError) -> Self
Source§impl From<DescribeEmergencyContactSettingsError> for Error
impl From<DescribeEmergencyContactSettingsError> for Error
Source§fn from(err: DescribeEmergencyContactSettingsError) -> Self
fn from(err: DescribeEmergencyContactSettingsError) -> Self
Source§impl From<DescribeProtectionError> for Error
impl From<DescribeProtectionError> for Error
Source§fn from(err: DescribeProtectionError) -> Self
fn from(err: DescribeProtectionError) -> Self
Source§impl From<DescribeProtectionGroupError> for Error
impl From<DescribeProtectionGroupError> for Error
Source§fn from(err: DescribeProtectionGroupError) -> Self
fn from(err: DescribeProtectionGroupError) -> Self
Source§impl From<DescribeSubscriptionError> for Error
impl From<DescribeSubscriptionError> for Error
Source§fn from(err: DescribeSubscriptionError) -> Self
fn from(err: DescribeSubscriptionError) -> Self
Source§impl From<DisableApplicationLayerAutomaticResponseError> for Error
impl From<DisableApplicationLayerAutomaticResponseError> for Error
Source§fn from(err: DisableApplicationLayerAutomaticResponseError) -> Self
fn from(err: DisableApplicationLayerAutomaticResponseError) -> Self
Source§impl From<DisableProactiveEngagementError> for Error
impl From<DisableProactiveEngagementError> for Error
Source§fn from(err: DisableProactiveEngagementError) -> Self
fn from(err: DisableProactiveEngagementError) -> Self
Source§impl From<DisassociateDRTLogBucketError> for Error
impl From<DisassociateDRTLogBucketError> for Error
Source§fn from(err: DisassociateDRTLogBucketError) -> Self
fn from(err: DisassociateDRTLogBucketError) -> Self
Source§impl From<DisassociateDRTRoleError> for Error
impl From<DisassociateDRTRoleError> for Error
Source§fn from(err: DisassociateDRTRoleError) -> Self
fn from(err: DisassociateDRTRoleError) -> Self
Source§impl From<DisassociateHealthCheckError> for Error
impl From<DisassociateHealthCheckError> for Error
Source§fn from(err: DisassociateHealthCheckError) -> Self
fn from(err: DisassociateHealthCheckError) -> Self
Source§impl From<EnableApplicationLayerAutomaticResponseError> for Error
impl From<EnableApplicationLayerAutomaticResponseError> for Error
Source§fn from(err: EnableApplicationLayerAutomaticResponseError) -> Self
fn from(err: EnableApplicationLayerAutomaticResponseError) -> Self
Source§impl From<EnableProactiveEngagementError> for Error
impl From<EnableProactiveEngagementError> for Error
Source§fn from(err: EnableProactiveEngagementError) -> Self
fn from(err: EnableProactiveEngagementError) -> Self
Source§impl From<GetSubscriptionStateError> for Error
impl From<GetSubscriptionStateError> for Error
Source§fn from(err: GetSubscriptionStateError) -> Self
fn from(err: GetSubscriptionStateError) -> Self
Source§impl From<ListAttacksError> for Error
impl From<ListAttacksError> for Error
Source§fn from(err: ListAttacksError) -> Self
fn from(err: ListAttacksError) -> Self
Source§impl From<ListProtectionGroupsError> for Error
impl From<ListProtectionGroupsError> for Error
Source§fn from(err: ListProtectionGroupsError) -> Self
fn from(err: ListProtectionGroupsError) -> Self
Source§impl From<ListProtectionsError> for Error
impl From<ListProtectionsError> for Error
Source§fn from(err: ListProtectionsError) -> Self
fn from(err: ListProtectionsError) -> Self
Source§impl From<ListResourcesInProtectionGroupError> for Error
impl From<ListResourcesInProtectionGroupError> for Error
Source§fn from(err: ListResourcesInProtectionGroupError) -> Self
fn from(err: ListResourcesInProtectionGroupError) -> 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<R> From<SdkError<AssociateDRTLogBucketError, R>> for Error
impl<R> From<SdkError<AssociateDRTLogBucketError, R>> for Error
Source§fn from(err: SdkError<AssociateDRTLogBucketError, R>) -> Self
fn from(err: SdkError<AssociateDRTLogBucketError, R>) -> Self
Source§impl<R> From<SdkError<AssociateDRTRoleError, R>> for Error
impl<R> From<SdkError<AssociateDRTRoleError, R>> for Error
Source§fn from(err: SdkError<AssociateDRTRoleError, R>) -> Self
fn from(err: SdkError<AssociateDRTRoleError, R>) -> Self
Source§impl<R> From<SdkError<AssociateHealthCheckError, R>> for Error
impl<R> From<SdkError<AssociateHealthCheckError, R>> for Error
Source§fn from(err: SdkError<AssociateHealthCheckError, R>) -> Self
fn from(err: SdkError<AssociateHealthCheckError, R>) -> Self
Source§impl<R> From<SdkError<AssociateProactiveEngagementDetailsError, R>> for Error
impl<R> From<SdkError<AssociateProactiveEngagementDetailsError, R>> for Error
Source§fn from(err: SdkError<AssociateProactiveEngagementDetailsError, R>) -> Self
fn from(err: SdkError<AssociateProactiveEngagementDetailsError, R>) -> Self
Source§impl<R> From<SdkError<CreateProtectionError, R>> for Error
impl<R> From<SdkError<CreateProtectionError, R>> for Error
Source§fn from(err: SdkError<CreateProtectionError, R>) -> Self
fn from(err: SdkError<CreateProtectionError, R>) -> Self
Source§impl<R> From<SdkError<CreateProtectionGroupError, R>> for Error
impl<R> From<SdkError<CreateProtectionGroupError, R>> for Error
Source§fn from(err: SdkError<CreateProtectionGroupError, R>) -> Self
fn from(err: SdkError<CreateProtectionGroupError, R>) -> Self
Source§impl<R> From<SdkError<CreateSubscriptionError, R>> for Error
impl<R> From<SdkError<CreateSubscriptionError, R>> for Error
Source§fn from(err: SdkError<CreateSubscriptionError, R>) -> Self
fn from(err: SdkError<CreateSubscriptionError, R>) -> Self
Source§impl<R> From<SdkError<DeleteProtectionError, R>> for Error
impl<R> From<SdkError<DeleteProtectionError, R>> for Error
Source§fn from(err: SdkError<DeleteProtectionError, R>) -> Self
fn from(err: SdkError<DeleteProtectionError, R>) -> Self
Source§impl<R> From<SdkError<DeleteProtectionGroupError, R>> for Error
impl<R> From<SdkError<DeleteProtectionGroupError, R>> for Error
Source§fn from(err: SdkError<DeleteProtectionGroupError, R>) -> Self
fn from(err: SdkError<DeleteProtectionGroupError, R>) -> Self
Source§impl<R> From<SdkError<DeleteSubscriptionError, R>> for Error
impl<R> From<SdkError<DeleteSubscriptionError, R>> for Error
Source§fn from(err: SdkError<DeleteSubscriptionError, R>) -> Self
fn from(err: SdkError<DeleteSubscriptionError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAttackError, R>> for Error
impl<R> From<SdkError<DescribeAttackError, R>> for Error
Source§fn from(err: SdkError<DescribeAttackError, R>) -> Self
fn from(err: SdkError<DescribeAttackError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAttackStatisticsError, R>> for Error
impl<R> From<SdkError<DescribeAttackStatisticsError, R>> for Error
Source§fn from(err: SdkError<DescribeAttackStatisticsError, R>) -> Self
fn from(err: SdkError<DescribeAttackStatisticsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeDRTAccessError, R>> for Error
impl<R> From<SdkError<DescribeDRTAccessError, R>> for Error
Source§fn from(err: SdkError<DescribeDRTAccessError, R>) -> Self
fn from(err: SdkError<DescribeDRTAccessError, R>) -> Self
Source§impl<R> From<SdkError<DescribeEmergencyContactSettingsError, R>> for Error
impl<R> From<SdkError<DescribeEmergencyContactSettingsError, R>> for Error
Source§fn from(err: SdkError<DescribeEmergencyContactSettingsError, R>) -> Self
fn from(err: SdkError<DescribeEmergencyContactSettingsError, R>) -> Self
Source§impl<R> From<SdkError<DescribeProtectionError, R>> for Error
impl<R> From<SdkError<DescribeProtectionError, R>> for Error
Source§fn from(err: SdkError<DescribeProtectionError, R>) -> Self
fn from(err: SdkError<DescribeProtectionError, R>) -> Self
Source§impl<R> From<SdkError<DescribeProtectionGroupError, R>> for Error
impl<R> From<SdkError<DescribeProtectionGroupError, R>> for Error
Source§fn from(err: SdkError<DescribeProtectionGroupError, R>) -> Self
fn from(err: SdkError<DescribeProtectionGroupError, R>) -> Self
Source§impl<R> From<SdkError<DescribeSubscriptionError, R>> for Error
impl<R> From<SdkError<DescribeSubscriptionError, R>> for Error
Source§fn from(err: SdkError<DescribeSubscriptionError, R>) -> Self
fn from(err: SdkError<DescribeSubscriptionError, R>) -> Self
Source§impl<R> From<SdkError<DisableApplicationLayerAutomaticResponseError, R>> for Error
impl<R> From<SdkError<DisableApplicationLayerAutomaticResponseError, R>> for Error
Source§fn from(err: SdkError<DisableApplicationLayerAutomaticResponseError, R>) -> Self
fn from(err: SdkError<DisableApplicationLayerAutomaticResponseError, R>) -> Self
Source§impl<R> From<SdkError<DisableProactiveEngagementError, R>> for Error
impl<R> From<SdkError<DisableProactiveEngagementError, R>> for Error
Source§fn from(err: SdkError<DisableProactiveEngagementError, R>) -> Self
fn from(err: SdkError<DisableProactiveEngagementError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateDRTLogBucketError, R>> for Error
impl<R> From<SdkError<DisassociateDRTLogBucketError, R>> for Error
Source§fn from(err: SdkError<DisassociateDRTLogBucketError, R>) -> Self
fn from(err: SdkError<DisassociateDRTLogBucketError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateDRTRoleError, R>> for Error
impl<R> From<SdkError<DisassociateDRTRoleError, R>> for Error
Source§fn from(err: SdkError<DisassociateDRTRoleError, R>) -> Self
fn from(err: SdkError<DisassociateDRTRoleError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateHealthCheckError, R>> for Error
impl<R> From<SdkError<DisassociateHealthCheckError, R>> for Error
Source§fn from(err: SdkError<DisassociateHealthCheckError, R>) -> Self
fn from(err: SdkError<DisassociateHealthCheckError, R>) -> Self
Source§impl<R> From<SdkError<EnableApplicationLayerAutomaticResponseError, R>> for Error
impl<R> From<SdkError<EnableApplicationLayerAutomaticResponseError, R>> for Error
Source§fn from(err: SdkError<EnableApplicationLayerAutomaticResponseError, R>) -> Self
fn from(err: SdkError<EnableApplicationLayerAutomaticResponseError, R>) -> Self
Source§impl<R> From<SdkError<EnableProactiveEngagementError, R>> for Error
impl<R> From<SdkError<EnableProactiveEngagementError, R>> for Error
Source§fn from(err: SdkError<EnableProactiveEngagementError, R>) -> Self
fn from(err: SdkError<EnableProactiveEngagementError, R>) -> Self
Source§impl<R> From<SdkError<GetSubscriptionStateError, R>> for Error
impl<R> From<SdkError<GetSubscriptionStateError, R>> for Error
Source§fn from(err: SdkError<GetSubscriptionStateError, R>) -> Self
fn from(err: SdkError<GetSubscriptionStateError, R>) -> Self
Source§impl<R> From<SdkError<ListAttacksError, R>> for Error
impl<R> From<SdkError<ListAttacksError, R>> for Error
Source§fn from(err: SdkError<ListAttacksError, R>) -> Self
fn from(err: SdkError<ListAttacksError, R>) -> Self
Source§impl<R> From<SdkError<ListProtectionGroupsError, R>> for Error
impl<R> From<SdkError<ListProtectionGroupsError, R>> for Error
Source§fn from(err: SdkError<ListProtectionGroupsError, R>) -> Self
fn from(err: SdkError<ListProtectionGroupsError, R>) -> Self
Source§impl<R> From<SdkError<ListProtectionsError, R>> for Error
impl<R> From<SdkError<ListProtectionsError, R>> for Error
Source§fn from(err: SdkError<ListProtectionsError, R>) -> Self
fn from(err: SdkError<ListProtectionsError, R>) -> Self
Source§impl<R> From<SdkError<ListResourcesInProtectionGroupError, R>> for Error
impl<R> From<SdkError<ListResourcesInProtectionGroupError, R>> for Error
Source§fn from(err: SdkError<ListResourcesInProtectionGroupError, R>) -> Self
fn from(err: SdkError<ListResourcesInProtectionGroupError, 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<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<UpdateApplicationLayerAutomaticResponseError, R>> for Error
impl<R> From<SdkError<UpdateApplicationLayerAutomaticResponseError, R>> for Error
Source§fn from(err: SdkError<UpdateApplicationLayerAutomaticResponseError, R>) -> Self
fn from(err: SdkError<UpdateApplicationLayerAutomaticResponseError, R>) -> Self
Source§impl<R> From<SdkError<UpdateEmergencyContactSettingsError, R>> for Error
impl<R> From<SdkError<UpdateEmergencyContactSettingsError, R>> for Error
Source§fn from(err: SdkError<UpdateEmergencyContactSettingsError, R>) -> Self
fn from(err: SdkError<UpdateEmergencyContactSettingsError, R>) -> Self
Source§impl<R> From<SdkError<UpdateProtectionGroupError, R>> for Error
impl<R> From<SdkError<UpdateProtectionGroupError, R>> for Error
Source§fn from(err: SdkError<UpdateProtectionGroupError, R>) -> Self
fn from(err: SdkError<UpdateProtectionGroupError, R>) -> Self
Source§impl<R> From<SdkError<UpdateSubscriptionError, R>> for Error
impl<R> From<SdkError<UpdateSubscriptionError, R>> for Error
Source§fn from(err: SdkError<UpdateSubscriptionError, R>) -> Self
fn from(err: SdkError<UpdateSubscriptionError, R>) -> 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<UpdateApplicationLayerAutomaticResponseError> for Error
impl From<UpdateApplicationLayerAutomaticResponseError> for Error
Source§fn from(err: UpdateApplicationLayerAutomaticResponseError) -> Self
fn from(err: UpdateApplicationLayerAutomaticResponseError) -> Self
Source§impl From<UpdateEmergencyContactSettingsError> for Error
impl From<UpdateEmergencyContactSettingsError> for Error
Source§fn from(err: UpdateEmergencyContactSettingsError) -> Self
fn from(err: UpdateEmergencyContactSettingsError) -> Self
Source§impl From<UpdateProtectionGroupError> for Error
impl From<UpdateProtectionGroupError> for Error
Source§fn from(err: UpdateProtectionGroupError) -> Self
fn from(err: UpdateProtectionGroupError) -> Self
Source§impl From<UpdateSubscriptionError> for Error
impl From<UpdateSubscriptionError> for Error
Source§fn from(err: UpdateSubscriptionError) -> Self
fn from(err: UpdateSubscriptionError) -> 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>
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>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
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>
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>
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>
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>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
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);