#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
ConflictException(ConflictException),
PreconditionFailedException(PreconditionFailedException),
RequestTimeoutException(RequestTimeoutException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceQuotaExceededException(ServiceQuotaExceededException),
TooManyTagsException(TooManyTagsException),
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.
ConflictException(ConflictException)
The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create
API (such as CreateAssistant
) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.
PreconditionFailedException(PreconditionFailedException)
The provided revisionId
does not match, indicating the content has been modified since it was last read.
RequestTimeoutException(RequestTimeoutException)
The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future.
ResourceNotFoundException(ResourceNotFoundException)
The specified resource does not exist.
ServiceQuotaExceededException(ServiceQuotaExceededException)
You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.
TooManyTagsException(TooManyTagsException)
Amazon Connect Wisdom throws this exception if you have too many tags in your tag set.
ValidationException(ValidationException)
The input fails to satisfy the constraints specified by a service.
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<CreateAssistantAssociationError> for Error
impl From<CreateAssistantAssociationError> for Error
Source§fn from(err: CreateAssistantAssociationError) -> Self
fn from(err: CreateAssistantAssociationError) -> Self
Source§impl From<CreateAssistantError> for Error
impl From<CreateAssistantError> for Error
Source§fn from(err: CreateAssistantError) -> Self
fn from(err: CreateAssistantError) -> Self
Source§impl From<CreateContentError> for Error
impl From<CreateContentError> for Error
Source§fn from(err: CreateContentError) -> Self
fn from(err: CreateContentError) -> Self
Source§impl From<CreateKnowledgeBaseError> for Error
impl From<CreateKnowledgeBaseError> for Error
Source§fn from(err: CreateKnowledgeBaseError) -> Self
fn from(err: CreateKnowledgeBaseError) -> Self
Source§impl From<CreateQuickResponseError> for Error
impl From<CreateQuickResponseError> for Error
Source§fn from(err: CreateQuickResponseError) -> Self
fn from(err: CreateQuickResponseError) -> Self
Source§impl From<CreateSessionError> for Error
impl From<CreateSessionError> for Error
Source§fn from(err: CreateSessionError) -> Self
fn from(err: CreateSessionError) -> Self
Source§impl From<DeleteAssistantAssociationError> for Error
impl From<DeleteAssistantAssociationError> for Error
Source§fn from(err: DeleteAssistantAssociationError) -> Self
fn from(err: DeleteAssistantAssociationError) -> Self
Source§impl From<DeleteAssistantError> for Error
impl From<DeleteAssistantError> for Error
Source§fn from(err: DeleteAssistantError) -> Self
fn from(err: DeleteAssistantError) -> Self
Source§impl From<DeleteContentError> for Error
impl From<DeleteContentError> for Error
Source§fn from(err: DeleteContentError) -> Self
fn from(err: DeleteContentError) -> Self
Source§impl From<DeleteImportJobError> for Error
impl From<DeleteImportJobError> for Error
Source§fn from(err: DeleteImportJobError) -> Self
fn from(err: DeleteImportJobError) -> Self
Source§impl From<DeleteKnowledgeBaseError> for Error
impl From<DeleteKnowledgeBaseError> for Error
Source§fn from(err: DeleteKnowledgeBaseError) -> Self
fn from(err: DeleteKnowledgeBaseError) -> Self
Source§impl From<DeleteQuickResponseError> for Error
impl From<DeleteQuickResponseError> for Error
Source§fn from(err: DeleteQuickResponseError) -> Self
fn from(err: DeleteQuickResponseError) -> Self
Source§impl From<GetAssistantAssociationError> for Error
impl From<GetAssistantAssociationError> for Error
Source§fn from(err: GetAssistantAssociationError) -> Self
fn from(err: GetAssistantAssociationError) -> Self
Source§impl From<GetAssistantError> for Error
impl From<GetAssistantError> for Error
Source§fn from(err: GetAssistantError) -> Self
fn from(err: GetAssistantError) -> Self
Source§impl From<GetContentError> for Error
impl From<GetContentError> for Error
Source§fn from(err: GetContentError) -> Self
fn from(err: GetContentError) -> Self
Source§impl From<GetContentSummaryError> for Error
impl From<GetContentSummaryError> for Error
Source§fn from(err: GetContentSummaryError) -> Self
fn from(err: GetContentSummaryError) -> Self
Source§impl From<GetImportJobError> for Error
impl From<GetImportJobError> for Error
Source§fn from(err: GetImportJobError) -> Self
fn from(err: GetImportJobError) -> Self
Source§impl From<GetKnowledgeBaseError> for Error
impl From<GetKnowledgeBaseError> for Error
Source§fn from(err: GetKnowledgeBaseError) -> Self
fn from(err: GetKnowledgeBaseError) -> Self
Source§impl From<GetQuickResponseError> for Error
impl From<GetQuickResponseError> for Error
Source§fn from(err: GetQuickResponseError) -> Self
fn from(err: GetQuickResponseError) -> Self
Source§impl From<GetRecommendationsError> for Error
impl From<GetRecommendationsError> for Error
Source§fn from(err: GetRecommendationsError) -> Self
fn from(err: GetRecommendationsError) -> Self
Source§impl From<GetSessionError> for Error
impl From<GetSessionError> for Error
Source§fn from(err: GetSessionError) -> Self
fn from(err: GetSessionError) -> Self
Source§impl From<ListAssistantAssociationsError> for Error
impl From<ListAssistantAssociationsError> for Error
Source§fn from(err: ListAssistantAssociationsError) -> Self
fn from(err: ListAssistantAssociationsError) -> Self
Source§impl From<ListAssistantsError> for Error
impl From<ListAssistantsError> for Error
Source§fn from(err: ListAssistantsError) -> Self
fn from(err: ListAssistantsError) -> Self
Source§impl From<ListContentsError> for Error
impl From<ListContentsError> for Error
Source§fn from(err: ListContentsError) -> Self
fn from(err: ListContentsError) -> Self
Source§impl From<ListImportJobsError> for Error
impl From<ListImportJobsError> for Error
Source§fn from(err: ListImportJobsError) -> Self
fn from(err: ListImportJobsError) -> Self
Source§impl From<ListKnowledgeBasesError> for Error
impl From<ListKnowledgeBasesError> for Error
Source§fn from(err: ListKnowledgeBasesError) -> Self
fn from(err: ListKnowledgeBasesError) -> Self
Source§impl From<ListQuickResponsesError> for Error
impl From<ListQuickResponsesError> for Error
Source§fn from(err: ListQuickResponsesError) -> Self
fn from(err: ListQuickResponsesError) -> 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<NotifyRecommendationsReceivedError> for Error
impl From<NotifyRecommendationsReceivedError> for Error
Source§fn from(err: NotifyRecommendationsReceivedError) -> Self
fn from(err: NotifyRecommendationsReceivedError) -> Self
Source§impl From<QueryAssistantError> for Error
impl From<QueryAssistantError> for Error
Source§fn from(err: QueryAssistantError) -> Self
fn from(err: QueryAssistantError) -> Self
Source§impl From<RemoveKnowledgeBaseTemplateUriError> for Error
impl From<RemoveKnowledgeBaseTemplateUriError> for Error
Source§fn from(err: RemoveKnowledgeBaseTemplateUriError) -> Self
fn from(err: RemoveKnowledgeBaseTemplateUriError) -> Self
Source§impl<R> From<SdkError<CreateAssistantAssociationError, R>> for Error
impl<R> From<SdkError<CreateAssistantAssociationError, R>> for Error
Source§fn from(err: SdkError<CreateAssistantAssociationError, R>) -> Self
fn from(err: SdkError<CreateAssistantAssociationError, R>) -> Self
Source§impl<R> From<SdkError<CreateAssistantError, R>> for Error
impl<R> From<SdkError<CreateAssistantError, R>> for Error
Source§fn from(err: SdkError<CreateAssistantError, R>) -> Self
fn from(err: SdkError<CreateAssistantError, R>) -> Self
Source§impl<R> From<SdkError<CreateContentError, R>> for Error
impl<R> From<SdkError<CreateContentError, R>> for Error
Source§fn from(err: SdkError<CreateContentError, R>) -> Self
fn from(err: SdkError<CreateContentError, R>) -> Self
Source§impl<R> From<SdkError<CreateKnowledgeBaseError, R>> for Error
impl<R> From<SdkError<CreateKnowledgeBaseError, R>> for Error
Source§fn from(err: SdkError<CreateKnowledgeBaseError, R>) -> Self
fn from(err: SdkError<CreateKnowledgeBaseError, R>) -> Self
Source§impl<R> From<SdkError<CreateQuickResponseError, R>> for Error
impl<R> From<SdkError<CreateQuickResponseError, R>> for Error
Source§fn from(err: SdkError<CreateQuickResponseError, R>) -> Self
fn from(err: SdkError<CreateQuickResponseError, R>) -> Self
Source§impl<R> From<SdkError<CreateSessionError, R>> for Error
impl<R> From<SdkError<CreateSessionError, R>> for Error
Source§fn from(err: SdkError<CreateSessionError, R>) -> Self
fn from(err: SdkError<CreateSessionError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAssistantAssociationError, R>> for Error
impl<R> From<SdkError<DeleteAssistantAssociationError, R>> for Error
Source§fn from(err: SdkError<DeleteAssistantAssociationError, R>) -> Self
fn from(err: SdkError<DeleteAssistantAssociationError, R>) -> Self
Source§impl<R> From<SdkError<DeleteAssistantError, R>> for Error
impl<R> From<SdkError<DeleteAssistantError, R>> for Error
Source§fn from(err: SdkError<DeleteAssistantError, R>) -> Self
fn from(err: SdkError<DeleteAssistantError, R>) -> Self
Source§impl<R> From<SdkError<DeleteContentError, R>> for Error
impl<R> From<SdkError<DeleteContentError, R>> for Error
Source§fn from(err: SdkError<DeleteContentError, R>) -> Self
fn from(err: SdkError<DeleteContentError, R>) -> Self
Source§impl<R> From<SdkError<DeleteImportJobError, R>> for Error
impl<R> From<SdkError<DeleteImportJobError, R>> for Error
Source§fn from(err: SdkError<DeleteImportJobError, R>) -> Self
fn from(err: SdkError<DeleteImportJobError, R>) -> Self
Source§impl<R> From<SdkError<DeleteKnowledgeBaseError, R>> for Error
impl<R> From<SdkError<DeleteKnowledgeBaseError, R>> for Error
Source§fn from(err: SdkError<DeleteKnowledgeBaseError, R>) -> Self
fn from(err: SdkError<DeleteKnowledgeBaseError, R>) -> Self
Source§impl<R> From<SdkError<DeleteQuickResponseError, R>> for Error
impl<R> From<SdkError<DeleteQuickResponseError, R>> for Error
Source§fn from(err: SdkError<DeleteQuickResponseError, R>) -> Self
fn from(err: SdkError<DeleteQuickResponseError, R>) -> Self
Source§impl<R> From<SdkError<GetAssistantAssociationError, R>> for Error
impl<R> From<SdkError<GetAssistantAssociationError, R>> for Error
Source§fn from(err: SdkError<GetAssistantAssociationError, R>) -> Self
fn from(err: SdkError<GetAssistantAssociationError, R>) -> Self
Source§impl<R> From<SdkError<GetAssistantError, R>> for Error
impl<R> From<SdkError<GetAssistantError, R>> for Error
Source§fn from(err: SdkError<GetAssistantError, R>) -> Self
fn from(err: SdkError<GetAssistantError, R>) -> Self
Source§impl<R> From<SdkError<GetContentError, R>> for Error
impl<R> From<SdkError<GetContentError, R>> for Error
Source§fn from(err: SdkError<GetContentError, R>) -> Self
fn from(err: SdkError<GetContentError, R>) -> Self
Source§impl<R> From<SdkError<GetContentSummaryError, R>> for Error
impl<R> From<SdkError<GetContentSummaryError, R>> for Error
Source§fn from(err: SdkError<GetContentSummaryError, R>) -> Self
fn from(err: SdkError<GetContentSummaryError, R>) -> Self
Source§impl<R> From<SdkError<GetImportJobError, R>> for Error
impl<R> From<SdkError<GetImportJobError, R>> for Error
Source§fn from(err: SdkError<GetImportJobError, R>) -> Self
fn from(err: SdkError<GetImportJobError, R>) -> Self
Source§impl<R> From<SdkError<GetKnowledgeBaseError, R>> for Error
impl<R> From<SdkError<GetKnowledgeBaseError, R>> for Error
Source§fn from(err: SdkError<GetKnowledgeBaseError, R>) -> Self
fn from(err: SdkError<GetKnowledgeBaseError, R>) -> Self
Source§impl<R> From<SdkError<GetQuickResponseError, R>> for Error
impl<R> From<SdkError<GetQuickResponseError, R>> for Error
Source§fn from(err: SdkError<GetQuickResponseError, R>) -> Self
fn from(err: SdkError<GetQuickResponseError, R>) -> Self
Source§impl<R> From<SdkError<GetRecommendationsError, R>> for Error
impl<R> From<SdkError<GetRecommendationsError, R>> for Error
Source§fn from(err: SdkError<GetRecommendationsError, R>) -> Self
fn from(err: SdkError<GetRecommendationsError, R>) -> Self
Source§impl<R> From<SdkError<GetSessionError, R>> for Error
impl<R> From<SdkError<GetSessionError, R>> for Error
Source§fn from(err: SdkError<GetSessionError, R>) -> Self
fn from(err: SdkError<GetSessionError, R>) -> Self
Source§impl<R> From<SdkError<ListAssistantAssociationsError, R>> for Error
impl<R> From<SdkError<ListAssistantAssociationsError, R>> for Error
Source§fn from(err: SdkError<ListAssistantAssociationsError, R>) -> Self
fn from(err: SdkError<ListAssistantAssociationsError, R>) -> Self
Source§impl<R> From<SdkError<ListAssistantsError, R>> for Error
impl<R> From<SdkError<ListAssistantsError, R>> for Error
Source§fn from(err: SdkError<ListAssistantsError, R>) -> Self
fn from(err: SdkError<ListAssistantsError, R>) -> Self
Source§impl<R> From<SdkError<ListContentsError, R>> for Error
impl<R> From<SdkError<ListContentsError, R>> for Error
Source§fn from(err: SdkError<ListContentsError, R>) -> Self
fn from(err: SdkError<ListContentsError, R>) -> Self
Source§impl<R> From<SdkError<ListImportJobsError, R>> for Error
impl<R> From<SdkError<ListImportJobsError, R>> for Error
Source§fn from(err: SdkError<ListImportJobsError, R>) -> Self
fn from(err: SdkError<ListImportJobsError, R>) -> Self
Source§impl<R> From<SdkError<ListKnowledgeBasesError, R>> for Error
impl<R> From<SdkError<ListKnowledgeBasesError, R>> for Error
Source§fn from(err: SdkError<ListKnowledgeBasesError, R>) -> Self
fn from(err: SdkError<ListKnowledgeBasesError, R>) -> Self
Source§impl<R> From<SdkError<ListQuickResponsesError, R>> for Error
impl<R> From<SdkError<ListQuickResponsesError, R>> for Error
Source§fn from(err: SdkError<ListQuickResponsesError, R>) -> Self
fn from(err: SdkError<ListQuickResponsesError, 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<NotifyRecommendationsReceivedError, R>> for Error
impl<R> From<SdkError<NotifyRecommendationsReceivedError, R>> for Error
Source§fn from(err: SdkError<NotifyRecommendationsReceivedError, R>) -> Self
fn from(err: SdkError<NotifyRecommendationsReceivedError, R>) -> Self
Source§impl<R> From<SdkError<QueryAssistantError, R>> for Error
impl<R> From<SdkError<QueryAssistantError, R>> for Error
Source§fn from(err: SdkError<QueryAssistantError, R>) -> Self
fn from(err: SdkError<QueryAssistantError, R>) -> Self
Source§impl<R> From<SdkError<RemoveKnowledgeBaseTemplateUriError, R>> for Error
impl<R> From<SdkError<RemoveKnowledgeBaseTemplateUriError, R>> for Error
Source§fn from(err: SdkError<RemoveKnowledgeBaseTemplateUriError, R>) -> Self
fn from(err: SdkError<RemoveKnowledgeBaseTemplateUriError, R>) -> Self
Source§impl<R> From<SdkError<SearchContentError, R>> for Error
impl<R> From<SdkError<SearchContentError, R>> for Error
Source§fn from(err: SdkError<SearchContentError, R>) -> Self
fn from(err: SdkError<SearchContentError, R>) -> Self
Source§impl<R> From<SdkError<SearchQuickResponsesError, R>> for Error
impl<R> From<SdkError<SearchQuickResponsesError, R>> for Error
Source§fn from(err: SdkError<SearchQuickResponsesError, R>) -> Self
fn from(err: SdkError<SearchQuickResponsesError, R>) -> Self
Source§impl<R> From<SdkError<SearchSessionsError, R>> for Error
impl<R> From<SdkError<SearchSessionsError, R>> for Error
Source§fn from(err: SdkError<SearchSessionsError, R>) -> Self
fn from(err: SdkError<SearchSessionsError, R>) -> Self
Source§impl<R> From<SdkError<StartContentUploadError, R>> for Error
impl<R> From<SdkError<StartContentUploadError, R>> for Error
Source§fn from(err: SdkError<StartContentUploadError, R>) -> Self
fn from(err: SdkError<StartContentUploadError, R>) -> Self
Source§impl<R> From<SdkError<StartImportJobError, R>> for Error
impl<R> From<SdkError<StartImportJobError, R>> for Error
Source§fn from(err: SdkError<StartImportJobError, R>) -> Self
fn from(err: SdkError<StartImportJobError, 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<UpdateContentError, R>> for Error
impl<R> From<SdkError<UpdateContentError, R>> for Error
Source§fn from(err: SdkError<UpdateContentError, R>) -> Self
fn from(err: SdkError<UpdateContentError, R>) -> Self
Source§impl<R> From<SdkError<UpdateKnowledgeBaseTemplateUriError, R>> for Error
impl<R> From<SdkError<UpdateKnowledgeBaseTemplateUriError, R>> for Error
Source§fn from(err: SdkError<UpdateKnowledgeBaseTemplateUriError, R>) -> Self
fn from(err: SdkError<UpdateKnowledgeBaseTemplateUriError, R>) -> Self
Source§impl<R> From<SdkError<UpdateQuickResponseError, R>> for Error
impl<R> From<SdkError<UpdateQuickResponseError, R>> for Error
Source§fn from(err: SdkError<UpdateQuickResponseError, R>) -> Self
fn from(err: SdkError<UpdateQuickResponseError, R>) -> Self
Source§impl From<SearchContentError> for Error
impl From<SearchContentError> for Error
Source§fn from(err: SearchContentError) -> Self
fn from(err: SearchContentError) -> Self
Source§impl From<SearchQuickResponsesError> for Error
impl From<SearchQuickResponsesError> for Error
Source§fn from(err: SearchQuickResponsesError) -> Self
fn from(err: SearchQuickResponsesError) -> Self
Source§impl From<SearchSessionsError> for Error
impl From<SearchSessionsError> for Error
Source§fn from(err: SearchSessionsError) -> Self
fn from(err: SearchSessionsError) -> Self
Source§impl From<StartContentUploadError> for Error
impl From<StartContentUploadError> for Error
Source§fn from(err: StartContentUploadError) -> Self
fn from(err: StartContentUploadError) -> Self
Source§impl From<StartImportJobError> for Error
impl From<StartImportJobError> for Error
Source§fn from(err: StartImportJobError) -> Self
fn from(err: StartImportJobError) -> 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<UpdateContentError> for Error
impl From<UpdateContentError> for Error
Source§fn from(err: UpdateContentError) -> Self
fn from(err: UpdateContentError) -> Self
Source§impl From<UpdateKnowledgeBaseTemplateUriError> for Error
impl From<UpdateKnowledgeBaseTemplateUriError> for Error
Source§fn from(err: UpdateKnowledgeBaseTemplateUriError) -> Self
fn from(err: UpdateKnowledgeBaseTemplateUriError) -> Self
Source§impl From<UpdateQuickResponseError> for Error
impl From<UpdateQuickResponseError> for Error
Source§fn from(err: UpdateQuickResponseError) -> Self
fn from(err: UpdateQuickResponseError) -> 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);