#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
ConflictException(ConflictException),
InternalServerException(InternalServerException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceQuotaExceededException(ServiceQuotaExceededException),
ServiceUnavailableException(ServiceUnavailableException),
ThrottlingException(ThrottlingException),
ValidationException(ValidationException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
You do not have sufficient access to perform this action.
This exception is thrown when the caller lacks the necessary IAM permissions to perform the requested operation. Verify that your IAM policy includes the required permissions for the specific Amazon Web Services Payment Cryptography action you're attempting.
ConflictException(ConflictException)
This request can cause an inconsistent state for the resource.
The requested operation conflicts with the current state of the resource. For example, attempting to delete a key that is currently being used, or trying to create a resource that already exists.
InternalServerException(InternalServerException)
The request processing has failed because of an unknown error, exception, or failure.
This indicates a server-side error within the Amazon Web Services Payment Cryptography service. If this error persists, contact support for assistance.
ResourceNotFoundException(ResourceNotFoundException)
The request was denied due to resource not found.
The specified key, alias, or other resource does not exist in your account or region. Verify that the resource identifier is correct and that the resource exists in the expected region.
ServiceQuotaExceededException(ServiceQuotaExceededException)
This request would cause a service quota to be exceeded.
You have reached the maximum number of keys, aliases, or other resources allowed in your account. Review your current usage and consider deleting unused resources or requesting a quota increase.
The service cannot complete the request.
The Amazon Web Services Payment Cryptography service is temporarily unavailable. This is typically a temporary condition - retry your request after a brief delay.
ThrottlingException(ThrottlingException)
The request was denied due to request throttling.
You have exceeded the rate limits for Amazon Web Services Payment Cryptography API calls. Implement exponential backoff and retry logic in your application to handle throttling gracefully.
ValidationException(ValidationException)
The request was denied due to an invalid request error.
One or more parameters in your request are invalid. Check the parameter values, formats, and constraints specified in the API documentation.
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<AddKeyReplicationRegionsError> for Error
impl From<AddKeyReplicationRegionsError> for Error
Source§fn from(err: AddKeyReplicationRegionsError) -> Self
fn from(err: AddKeyReplicationRegionsError) -> 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<CreateAliasError> for Error
impl From<CreateAliasError> for Error
Source§fn from(err: CreateAliasError) -> Self
fn from(err: CreateAliasError) -> Self
Source§impl From<CreateKeyError> for Error
impl From<CreateKeyError> for Error
Source§fn from(err: CreateKeyError) -> Self
fn from(err: CreateKeyError) -> Self
Source§impl From<DeleteAliasError> for Error
impl From<DeleteAliasError> for Error
Source§fn from(err: DeleteAliasError) -> Self
fn from(err: DeleteAliasError) -> Self
Source§impl From<DeleteKeyError> for Error
impl From<DeleteKeyError> for Error
Source§fn from(err: DeleteKeyError) -> Self
fn from(err: DeleteKeyError) -> Self
Source§impl From<DisableDefaultKeyReplicationRegionsError> for Error
impl From<DisableDefaultKeyReplicationRegionsError> for Error
Source§fn from(err: DisableDefaultKeyReplicationRegionsError) -> Self
fn from(err: DisableDefaultKeyReplicationRegionsError) -> Self
Source§impl From<EnableDefaultKeyReplicationRegionsError> for Error
impl From<EnableDefaultKeyReplicationRegionsError> for Error
Source§fn from(err: EnableDefaultKeyReplicationRegionsError) -> Self
fn from(err: EnableDefaultKeyReplicationRegionsError) -> Self
Source§impl From<ExportKeyError> for Error
impl From<ExportKeyError> for Error
Source§fn from(err: ExportKeyError) -> Self
fn from(err: ExportKeyError) -> Self
Source§impl From<GetAliasError> for Error
impl From<GetAliasError> for Error
Source§fn from(err: GetAliasError) -> Self
fn from(err: GetAliasError) -> Self
Source§impl From<GetDefaultKeyReplicationRegionsError> for Error
impl From<GetDefaultKeyReplicationRegionsError> for Error
Source§fn from(err: GetDefaultKeyReplicationRegionsError) -> Self
fn from(err: GetDefaultKeyReplicationRegionsError) -> Self
Source§impl From<GetKeyError> for Error
impl From<GetKeyError> for Error
Source§fn from(err: GetKeyError) -> Self
fn from(err: GetKeyError) -> Self
Source§impl From<GetParametersForExportError> for Error
impl From<GetParametersForExportError> for Error
Source§fn from(err: GetParametersForExportError) -> Self
fn from(err: GetParametersForExportError) -> Self
Source§impl From<GetParametersForImportError> for Error
impl From<GetParametersForImportError> for Error
Source§fn from(err: GetParametersForImportError) -> Self
fn from(err: GetParametersForImportError) -> Self
Source§impl From<GetPublicKeyCertificateError> for Error
impl From<GetPublicKeyCertificateError> for Error
Source§fn from(err: GetPublicKeyCertificateError) -> Self
fn from(err: GetPublicKeyCertificateError) -> Self
Source§impl From<ImportKeyError> for Error
impl From<ImportKeyError> for Error
Source§fn from(err: ImportKeyError) -> Self
fn from(err: ImportKeyError) -> Self
Source§impl From<ListAliasesError> for Error
impl From<ListAliasesError> for Error
Source§fn from(err: ListAliasesError) -> Self
fn from(err: ListAliasesError) -> Self
Source§impl From<ListKeysError> for Error
impl From<ListKeysError> for Error
Source§fn from(err: ListKeysError) -> Self
fn from(err: ListKeysError) -> 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<RemoveKeyReplicationRegionsError> for Error
impl From<RemoveKeyReplicationRegionsError> for Error
Source§fn from(err: RemoveKeyReplicationRegionsError) -> Self
fn from(err: RemoveKeyReplicationRegionsError) -> Self
Source§impl From<RestoreKeyError> for Error
impl From<RestoreKeyError> for Error
Source§fn from(err: RestoreKeyError) -> Self
fn from(err: RestoreKeyError) -> Self
Source§impl<R> From<SdkError<AddKeyReplicationRegionsError, R>> for Error
impl<R> From<SdkError<AddKeyReplicationRegionsError, R>> for Error
Source§fn from(err: SdkError<AddKeyReplicationRegionsError, R>) -> Self
fn from(err: SdkError<AddKeyReplicationRegionsError, R>) -> Self
Source§impl<R> From<SdkError<CreateAliasError, R>> for Error
impl<R> From<SdkError<CreateAliasError, R>> for Error
Source§fn from(err: SdkError<CreateAliasError, R>) -> Self
fn from(err: SdkError<CreateAliasError, R>) -> Self
Source§impl<R> From<SdkError<CreateKeyError, R>> for Error
impl<R> From<SdkError<CreateKeyError, R>> for Error
Source§fn from(err: SdkError<CreateKeyError, R>) -> Self
fn from(err: SdkError<CreateKeyError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAliasError, R>> for Error
impl<R> From<SdkError<DeleteAliasError, R>> for Error
Source§fn from(err: SdkError<DeleteAliasError, R>) -> Self
fn from(err: SdkError<DeleteAliasError, R>) -> Self
Source§impl<R> From<SdkError<DeleteKeyError, R>> for Error
impl<R> From<SdkError<DeleteKeyError, R>> for Error
Source§fn from(err: SdkError<DeleteKeyError, R>) -> Self
fn from(err: SdkError<DeleteKeyError, R>) -> Self
Source§impl<R> From<SdkError<DisableDefaultKeyReplicationRegionsError, R>> for Error
impl<R> From<SdkError<DisableDefaultKeyReplicationRegionsError, R>> for Error
Source§fn from(err: SdkError<DisableDefaultKeyReplicationRegionsError, R>) -> Self
fn from(err: SdkError<DisableDefaultKeyReplicationRegionsError, R>) -> Self
Source§impl<R> From<SdkError<EnableDefaultKeyReplicationRegionsError, R>> for Error
impl<R> From<SdkError<EnableDefaultKeyReplicationRegionsError, R>> for Error
Source§fn from(err: SdkError<EnableDefaultKeyReplicationRegionsError, R>) -> Self
fn from(err: SdkError<EnableDefaultKeyReplicationRegionsError, R>) -> Self
Source§impl<R> From<SdkError<ExportKeyError, R>> for Error
impl<R> From<SdkError<ExportKeyError, R>> for Error
Source§fn from(err: SdkError<ExportKeyError, R>) -> Self
fn from(err: SdkError<ExportKeyError, R>) -> Self
Source§impl<R> From<SdkError<GetAliasError, R>> for Error
impl<R> From<SdkError<GetAliasError, R>> for Error
Source§fn from(err: SdkError<GetAliasError, R>) -> Self
fn from(err: SdkError<GetAliasError, R>) -> Self
Source§impl<R> From<SdkError<GetDefaultKeyReplicationRegionsError, R>> for Error
impl<R> From<SdkError<GetDefaultKeyReplicationRegionsError, R>> for Error
Source§fn from(err: SdkError<GetDefaultKeyReplicationRegionsError, R>) -> Self
fn from(err: SdkError<GetDefaultKeyReplicationRegionsError, R>) -> Self
Source§impl<R> From<SdkError<GetKeyError, R>> for Error
impl<R> From<SdkError<GetKeyError, R>> for Error
Source§fn from(err: SdkError<GetKeyError, R>) -> Self
fn from(err: SdkError<GetKeyError, R>) -> Self
Source§impl<R> From<SdkError<GetParametersForExportError, R>> for Error
impl<R> From<SdkError<GetParametersForExportError, R>> for Error
Source§fn from(err: SdkError<GetParametersForExportError, R>) -> Self
fn from(err: SdkError<GetParametersForExportError, R>) -> Self
Source§impl<R> From<SdkError<GetParametersForImportError, R>> for Error
impl<R> From<SdkError<GetParametersForImportError, R>> for Error
Source§fn from(err: SdkError<GetParametersForImportError, R>) -> Self
fn from(err: SdkError<GetParametersForImportError, R>) -> Self
Source§impl<R> From<SdkError<GetPublicKeyCertificateError, R>> for Error
impl<R> From<SdkError<GetPublicKeyCertificateError, R>> for Error
Source§fn from(err: SdkError<GetPublicKeyCertificateError, R>) -> Self
fn from(err: SdkError<GetPublicKeyCertificateError, R>) -> Self
Source§impl<R> From<SdkError<ImportKeyError, R>> for Error
impl<R> From<SdkError<ImportKeyError, R>> for Error
Source§fn from(err: SdkError<ImportKeyError, R>) -> Self
fn from(err: SdkError<ImportKeyError, R>) -> Self
Source§impl<R> From<SdkError<ListAliasesError, R>> for Error
impl<R> From<SdkError<ListAliasesError, R>> for Error
Source§fn from(err: SdkError<ListAliasesError, R>) -> Self
fn from(err: SdkError<ListAliasesError, R>) -> Self
Source§impl<R> From<SdkError<ListKeysError, R>> for Error
impl<R> From<SdkError<ListKeysError, R>> for Error
Source§fn from(err: SdkError<ListKeysError, R>) -> Self
fn from(err: SdkError<ListKeysError, 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<RemoveKeyReplicationRegionsError, R>> for Error
impl<R> From<SdkError<RemoveKeyReplicationRegionsError, R>> for Error
Source§fn from(err: SdkError<RemoveKeyReplicationRegionsError, R>) -> Self
fn from(err: SdkError<RemoveKeyReplicationRegionsError, R>) -> Self
Source§impl<R> From<SdkError<RestoreKeyError, R>> for Error
impl<R> From<SdkError<RestoreKeyError, R>> for Error
Source§fn from(err: SdkError<RestoreKeyError, R>) -> Self
fn from(err: SdkError<RestoreKeyError, R>) -> Self
Source§impl<R> From<SdkError<StartKeyUsageError, R>> for Error
impl<R> From<SdkError<StartKeyUsageError, R>> for Error
Source§fn from(err: SdkError<StartKeyUsageError, R>) -> Self
fn from(err: SdkError<StartKeyUsageError, R>) -> Self
Source§impl<R> From<SdkError<StopKeyUsageError, R>> for Error
impl<R> From<SdkError<StopKeyUsageError, R>> for Error
Source§fn from(err: SdkError<StopKeyUsageError, R>) -> Self
fn from(err: SdkError<StopKeyUsageError, 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<UpdateAliasError, R>> for Error
impl<R> From<SdkError<UpdateAliasError, R>> for Error
Source§fn from(err: SdkError<UpdateAliasError, R>) -> Self
fn from(err: SdkError<UpdateAliasError, R>) -> Self
Source§impl From<StartKeyUsageError> for Error
impl From<StartKeyUsageError> for Error
Source§fn from(err: StartKeyUsageError) -> Self
fn from(err: StartKeyUsageError) -> Self
Source§impl From<StopKeyUsageError> for Error
impl From<StopKeyUsageError> for Error
Source§fn from(err: StopKeyUsageError) -> Self
fn from(err: StopKeyUsageError) -> 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<UpdateAliasError> for Error
impl From<UpdateAliasError> for Error
Source§fn from(err: UpdateAliasError) -> Self
fn from(err: UpdateAliasError) -> 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);