#[non_exhaustive]pub enum Error {
Show 16 variants
ConcurrentModificationException(ConcurrentModificationException),
ConflictException(ConflictException),
DetectedLanguageLowConfidenceException(DetectedLanguageLowConfidenceException),
InternalServerException(InternalServerException),
InvalidFilterException(InvalidFilterException),
InvalidParameterValueException(InvalidParameterValueException),
InvalidRequestException(InvalidRequestException),
LimitExceededException(LimitExceededException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceUnavailableException(ServiceUnavailableException),
TextSizeLimitExceededException(TextSizeLimitExceededException),
TooManyRequestsException(TooManyRequestsException),
TooManyTagsException(TooManyTagsException),
UnsupportedDisplayLanguageCodeException(UnsupportedDisplayLanguageCodeException),
UnsupportedLanguagePairException(UnsupportedLanguagePairException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConcurrentModificationException(ConcurrentModificationException)
Another modification is being made. That modification must complete before you can make your change.
ConflictException(ConflictException)
There was a conflict processing the request. Try your request again.
DetectedLanguageLowConfidenceException(DetectedLanguageLowConfidenceException)
The confidence that Amazon Comprehend accurately detected the source language is low. If a low confidence level is acceptable for your application, you can use the language in the exception to call Amazon Translate again. For more information, see the DetectDominantLanguage operation in the Amazon Comprehend Developer Guide.
InternalServerException(InternalServerException)
An internal server error occurred. Retry your request.
InvalidFilterException(InvalidFilterException)
The filter specified for the operation is not valid. Specify a different filter.
InvalidParameterValueException(InvalidParameterValueException)
The value of the parameter is not valid. Review the value of the parameter you are using to correct it, and then retry your operation.
InvalidRequestException(InvalidRequestException)
The request that you made is not valid. Check your request to determine why it's not valid and then retry the request.
LimitExceededException(LimitExceededException)
The specified limit has been exceeded. Review your request and retry it with a quantity below the stated limit.
ResourceNotFoundException(ResourceNotFoundException)
The resource you are looking for has not been found. Review the resource you're looking for and see if a different resource will accomplish your needs before retrying the revised request.
The Amazon Translate service is temporarily unavailable. Wait a bit and then retry your request.
TextSizeLimitExceededException(TextSizeLimitExceededException)
The size of the text you submitted exceeds the size limit. Reduce the size of the text or use a smaller document and then retry your request.
TooManyRequestsException(TooManyRequestsException)
You have made too many requests within a short period of time. Wait for a short time and then try your request again.
TooManyTagsException(TooManyTagsException)
You have added too many tags to this resource. The maximum is 50 tags.
UnsupportedDisplayLanguageCodeException(UnsupportedDisplayLanguageCodeException)
Requested display language code is not supported.
UnsupportedLanguagePairException(UnsupportedLanguagePairException)
Amazon Translate does not support translation from the language of the source text into the requested target language. For more information, see Supported languages.
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<BuildError> for Error
impl From<BuildError> for Error
Source§fn from(value: BuildError) -> Self
fn from(value: BuildError) -> Self
Source§impl From<CreateParallelDataError> for Error
impl From<CreateParallelDataError> for Error
Source§fn from(err: CreateParallelDataError) -> Self
fn from(err: CreateParallelDataError) -> Self
Source§impl From<DeleteParallelDataError> for Error
impl From<DeleteParallelDataError> for Error
Source§fn from(err: DeleteParallelDataError) -> Self
fn from(err: DeleteParallelDataError) -> Self
Source§impl From<DeleteTerminologyError> for Error
impl From<DeleteTerminologyError> for Error
Source§fn from(err: DeleteTerminologyError) -> Self
fn from(err: DeleteTerminologyError) -> Self
Source§impl From<DescribeTextTranslationJobError> for Error
impl From<DescribeTextTranslationJobError> for Error
Source§fn from(err: DescribeTextTranslationJobError) -> Self
fn from(err: DescribeTextTranslationJobError) -> Self
Source§impl From<GetParallelDataError> for Error
impl From<GetParallelDataError> for Error
Source§fn from(err: GetParallelDataError) -> Self
fn from(err: GetParallelDataError) -> Self
Source§impl From<GetTerminologyError> for Error
impl From<GetTerminologyError> for Error
Source§fn from(err: GetTerminologyError) -> Self
fn from(err: GetTerminologyError) -> Self
Source§impl From<ImportTerminologyError> for Error
impl From<ImportTerminologyError> for Error
Source§fn from(err: ImportTerminologyError) -> Self
fn from(err: ImportTerminologyError) -> Self
Source§impl From<ListLanguagesError> for Error
impl From<ListLanguagesError> for Error
Source§fn from(err: ListLanguagesError) -> Self
fn from(err: ListLanguagesError) -> Self
Source§impl From<ListParallelDataError> for Error
impl From<ListParallelDataError> for Error
Source§fn from(err: ListParallelDataError) -> Self
fn from(err: ListParallelDataError) -> 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<ListTerminologiesError> for Error
impl From<ListTerminologiesError> for Error
Source§fn from(err: ListTerminologiesError) -> Self
fn from(err: ListTerminologiesError) -> Self
Source§impl From<ListTextTranslationJobsError> for Error
impl From<ListTextTranslationJobsError> for Error
Source§fn from(err: ListTextTranslationJobsError) -> Self
fn from(err: ListTextTranslationJobsError) -> Self
Source§impl<R> From<SdkError<CreateParallelDataError, R>> for Error
impl<R> From<SdkError<CreateParallelDataError, R>> for Error
Source§fn from(err: SdkError<CreateParallelDataError, R>) -> Self
fn from(err: SdkError<CreateParallelDataError, R>) -> Self
Source§impl<R> From<SdkError<DeleteParallelDataError, R>> for Error
impl<R> From<SdkError<DeleteParallelDataError, R>> for Error
Source§fn from(err: SdkError<DeleteParallelDataError, R>) -> Self
fn from(err: SdkError<DeleteParallelDataError, R>) -> Self
Source§impl<R> From<SdkError<DeleteTerminologyError, R>> for Error
impl<R> From<SdkError<DeleteTerminologyError, R>> for Error
Source§fn from(err: SdkError<DeleteTerminologyError, R>) -> Self
fn from(err: SdkError<DeleteTerminologyError, R>) -> Self
Source§impl<R> From<SdkError<DescribeTextTranslationJobError, R>> for Error
impl<R> From<SdkError<DescribeTextTranslationJobError, R>> for Error
Source§fn from(err: SdkError<DescribeTextTranslationJobError, R>) -> Self
fn from(err: SdkError<DescribeTextTranslationJobError, R>) -> Self
Source§impl<R> From<SdkError<GetParallelDataError, R>> for Error
impl<R> From<SdkError<GetParallelDataError, R>> for Error
Source§fn from(err: SdkError<GetParallelDataError, R>) -> Self
fn from(err: SdkError<GetParallelDataError, R>) -> Self
Source§impl<R> From<SdkError<GetTerminologyError, R>> for Error
impl<R> From<SdkError<GetTerminologyError, R>> for Error
Source§fn from(err: SdkError<GetTerminologyError, R>) -> Self
fn from(err: SdkError<GetTerminologyError, R>) -> Self
Source§impl<R> From<SdkError<ImportTerminologyError, R>> for Error
impl<R> From<SdkError<ImportTerminologyError, R>> for Error
Source§fn from(err: SdkError<ImportTerminologyError, R>) -> Self
fn from(err: SdkError<ImportTerminologyError, R>) -> Self
Source§impl<R> From<SdkError<ListLanguagesError, R>> for Error
impl<R> From<SdkError<ListLanguagesError, R>> for Error
Source§fn from(err: SdkError<ListLanguagesError, R>) -> Self
fn from(err: SdkError<ListLanguagesError, R>) -> Self
Source§impl<R> From<SdkError<ListParallelDataError, R>> for Error
impl<R> From<SdkError<ListParallelDataError, R>> for Error
Source§fn from(err: SdkError<ListParallelDataError, R>) -> Self
fn from(err: SdkError<ListParallelDataError, 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<ListTerminologiesError, R>> for Error
impl<R> From<SdkError<ListTerminologiesError, R>> for Error
Source§fn from(err: SdkError<ListTerminologiesError, R>) -> Self
fn from(err: SdkError<ListTerminologiesError, R>) -> Self
Source§impl<R> From<SdkError<ListTextTranslationJobsError, R>> for Error
impl<R> From<SdkError<ListTextTranslationJobsError, R>> for Error
Source§fn from(err: SdkError<ListTextTranslationJobsError, R>) -> Self
fn from(err: SdkError<ListTextTranslationJobsError, R>) -> Self
Source§impl<R> From<SdkError<StartTextTranslationJobError, R>> for Error
impl<R> From<SdkError<StartTextTranslationJobError, R>> for Error
Source§fn from(err: SdkError<StartTextTranslationJobError, R>) -> Self
fn from(err: SdkError<StartTextTranslationJobError, R>) -> Self
Source§impl<R> From<SdkError<StopTextTranslationJobError, R>> for Error
impl<R> From<SdkError<StopTextTranslationJobError, R>> for Error
Source§fn from(err: SdkError<StopTextTranslationJobError, R>) -> Self
fn from(err: SdkError<StopTextTranslationJobError, 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<TranslateDocumentError, R>> for Error
impl<R> From<SdkError<TranslateDocumentError, R>> for Error
Source§fn from(err: SdkError<TranslateDocumentError, R>) -> Self
fn from(err: SdkError<TranslateDocumentError, R>) -> Self
Source§impl<R> From<SdkError<TranslateTextError, R>> for Error
impl<R> From<SdkError<TranslateTextError, R>> for Error
Source§fn from(err: SdkError<TranslateTextError, R>) -> Self
fn from(err: SdkError<TranslateTextError, 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<UpdateParallelDataError, R>> for Error
impl<R> From<SdkError<UpdateParallelDataError, R>> for Error
Source§fn from(err: SdkError<UpdateParallelDataError, R>) -> Self
fn from(err: SdkError<UpdateParallelDataError, R>) -> Self
Source§impl From<StartTextTranslationJobError> for Error
impl From<StartTextTranslationJobError> for Error
Source§fn from(err: StartTextTranslationJobError) -> Self
fn from(err: StartTextTranslationJobError) -> Self
Source§impl From<StopTextTranslationJobError> for Error
impl From<StopTextTranslationJobError> for Error
Source§fn from(err: StopTextTranslationJobError) -> Self
fn from(err: StopTextTranslationJobError) -> 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<TranslateDocumentError> for Error
impl From<TranslateDocumentError> for Error
Source§fn from(err: TranslateDocumentError) -> Self
fn from(err: TranslateDocumentError) -> Self
Source§impl From<TranslateTextError> for Error
impl From<TranslateTextError> for Error
Source§fn from(err: TranslateTextError) -> Self
fn from(err: TranslateTextError) -> 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<UpdateParallelDataError> for Error
impl From<UpdateParallelDataError> for Error
Source§fn from(err: UpdateParallelDataError) -> Self
fn from(err: UpdateParallelDataError) -> 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);