#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
ConflictException(ConflictException),
InternalServerException(InternalServerException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceQuotaExceededException(ServiceQuotaExceededException),
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 permissions to perform this action. Check the error message and try again.
ConflictException(ConflictException)
The request failed due to a conflict. Check the ConflictType
and error message for more details.
InternalServerException(InternalServerException)
The request failed due to an unknown error on the server side.
ResourceNotFoundException(ResourceNotFoundException)
The specified resource cannot be found. Check the ResourceType
and error message for more details.
ServiceQuotaExceededException(ServiceQuotaExceededException)
The request exceeded the service quota. Refer to Voice ID Service Quotas and try your request again.
ThrottlingException(ThrottlingException)
The request was denied due to request throttling. Please slow down your request rate. Refer to Amazon Connect Voice ID Service API throttling quotas and try your request again.
ValidationException(ValidationException)
The request failed one or more validations; check the error message for more details.
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<AssociateFraudsterError> for Error
impl From<AssociateFraudsterError> for Error
Source§fn from(err: AssociateFraudsterError) -> Self
fn from(err: AssociateFraudsterError) -> 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<CreateDomainError> for Error
impl From<CreateDomainError> for Error
Source§fn from(err: CreateDomainError) -> Self
fn from(err: CreateDomainError) -> Self
Source§impl From<CreateWatchlistError> for Error
impl From<CreateWatchlistError> for Error
Source§fn from(err: CreateWatchlistError) -> Self
fn from(err: CreateWatchlistError) -> Self
Source§impl From<DeleteDomainError> for Error
impl From<DeleteDomainError> for Error
Source§fn from(err: DeleteDomainError) -> Self
fn from(err: DeleteDomainError) -> Self
Source§impl From<DeleteFraudsterError> for Error
impl From<DeleteFraudsterError> for Error
Source§fn from(err: DeleteFraudsterError) -> Self
fn from(err: DeleteFraudsterError) -> Self
Source§impl From<DeleteSpeakerError> for Error
impl From<DeleteSpeakerError> for Error
Source§fn from(err: DeleteSpeakerError) -> Self
fn from(err: DeleteSpeakerError) -> Self
Source§impl From<DeleteWatchlistError> for Error
impl From<DeleteWatchlistError> for Error
Source§fn from(err: DeleteWatchlistError) -> Self
fn from(err: DeleteWatchlistError) -> Self
Source§impl From<DescribeDomainError> for Error
impl From<DescribeDomainError> for Error
Source§fn from(err: DescribeDomainError) -> Self
fn from(err: DescribeDomainError) -> Self
Source§impl From<DescribeFraudsterError> for Error
impl From<DescribeFraudsterError> for Error
Source§fn from(err: DescribeFraudsterError) -> Self
fn from(err: DescribeFraudsterError) -> Self
Source§impl From<DescribeFraudsterRegistrationJobError> for Error
impl From<DescribeFraudsterRegistrationJobError> for Error
Source§fn from(err: DescribeFraudsterRegistrationJobError) -> Self
fn from(err: DescribeFraudsterRegistrationJobError) -> Self
Source§impl From<DescribeSpeakerEnrollmentJobError> for Error
impl From<DescribeSpeakerEnrollmentJobError> for Error
Source§fn from(err: DescribeSpeakerEnrollmentJobError) -> Self
fn from(err: DescribeSpeakerEnrollmentJobError) -> Self
Source§impl From<DescribeSpeakerError> for Error
impl From<DescribeSpeakerError> for Error
Source§fn from(err: DescribeSpeakerError) -> Self
fn from(err: DescribeSpeakerError) -> Self
Source§impl From<DescribeWatchlistError> for Error
impl From<DescribeWatchlistError> for Error
Source§fn from(err: DescribeWatchlistError) -> Self
fn from(err: DescribeWatchlistError) -> Self
Source§impl From<DisassociateFraudsterError> for Error
impl From<DisassociateFraudsterError> for Error
Source§fn from(err: DisassociateFraudsterError) -> Self
fn from(err: DisassociateFraudsterError) -> Self
Source§impl From<EvaluateSessionError> for Error
impl From<EvaluateSessionError> for Error
Source§fn from(err: EvaluateSessionError) -> Self
fn from(err: EvaluateSessionError) -> Self
Source§impl From<ListDomainsError> for Error
impl From<ListDomainsError> for Error
Source§fn from(err: ListDomainsError) -> Self
fn from(err: ListDomainsError) -> Self
Source§impl From<ListFraudsterRegistrationJobsError> for Error
impl From<ListFraudsterRegistrationJobsError> for Error
Source§fn from(err: ListFraudsterRegistrationJobsError) -> Self
fn from(err: ListFraudsterRegistrationJobsError) -> Self
Source§impl From<ListFraudstersError> for Error
impl From<ListFraudstersError> for Error
Source§fn from(err: ListFraudstersError) -> Self
fn from(err: ListFraudstersError) -> Self
Source§impl From<ListSpeakerEnrollmentJobsError> for Error
impl From<ListSpeakerEnrollmentJobsError> for Error
Source§fn from(err: ListSpeakerEnrollmentJobsError) -> Self
fn from(err: ListSpeakerEnrollmentJobsError) -> Self
Source§impl From<ListSpeakersError> for Error
impl From<ListSpeakersError> for Error
Source§fn from(err: ListSpeakersError) -> Self
fn from(err: ListSpeakersError) -> 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<ListWatchlistsError> for Error
impl From<ListWatchlistsError> for Error
Source§fn from(err: ListWatchlistsError) -> Self
fn from(err: ListWatchlistsError) -> Self
Source§impl From<OptOutSpeakerError> for Error
impl From<OptOutSpeakerError> for Error
Source§fn from(err: OptOutSpeakerError) -> Self
fn from(err: OptOutSpeakerError) -> Self
Source§impl<R> From<SdkError<AssociateFraudsterError, R>> for Error
impl<R> From<SdkError<AssociateFraudsterError, R>> for Error
Source§fn from(err: SdkError<AssociateFraudsterError, R>) -> Self
fn from(err: SdkError<AssociateFraudsterError, R>) -> Self
Source§impl<R> From<SdkError<CreateDomainError, R>> for Error
impl<R> From<SdkError<CreateDomainError, R>> for Error
Source§fn from(err: SdkError<CreateDomainError, R>) -> Self
fn from(err: SdkError<CreateDomainError, R>) -> Self
Source§impl<R> From<SdkError<CreateWatchlistError, R>> for Error
impl<R> From<SdkError<CreateWatchlistError, R>> for Error
Source§fn from(err: SdkError<CreateWatchlistError, R>) -> Self
fn from(err: SdkError<CreateWatchlistError, R>) -> Self
Source§impl<R> From<SdkError<DeleteDomainError, R>> for Error
impl<R> From<SdkError<DeleteDomainError, R>> for Error
Source§fn from(err: SdkError<DeleteDomainError, R>) -> Self
fn from(err: SdkError<DeleteDomainError, R>) -> Self
Source§impl<R> From<SdkError<DeleteFraudsterError, R>> for Error
impl<R> From<SdkError<DeleteFraudsterError, R>> for Error
Source§fn from(err: SdkError<DeleteFraudsterError, R>) -> Self
fn from(err: SdkError<DeleteFraudsterError, R>) -> Self
Source§impl<R> From<SdkError<DeleteSpeakerError, R>> for Error
impl<R> From<SdkError<DeleteSpeakerError, R>> for Error
Source§fn from(err: SdkError<DeleteSpeakerError, R>) -> Self
fn from(err: SdkError<DeleteSpeakerError, R>) -> Self
Source§impl<R> From<SdkError<DeleteWatchlistError, R>> for Error
impl<R> From<SdkError<DeleteWatchlistError, R>> for Error
Source§fn from(err: SdkError<DeleteWatchlistError, R>) -> Self
fn from(err: SdkError<DeleteWatchlistError, R>) -> Self
Source§impl<R> From<SdkError<DescribeDomainError, R>> for Error
impl<R> From<SdkError<DescribeDomainError, R>> for Error
Source§fn from(err: SdkError<DescribeDomainError, R>) -> Self
fn from(err: SdkError<DescribeDomainError, R>) -> Self
Source§impl<R> From<SdkError<DescribeFraudsterError, R>> for Error
impl<R> From<SdkError<DescribeFraudsterError, R>> for Error
Source§fn from(err: SdkError<DescribeFraudsterError, R>) -> Self
fn from(err: SdkError<DescribeFraudsterError, R>) -> Self
Source§impl<R> From<SdkError<DescribeFraudsterRegistrationJobError, R>> for Error
impl<R> From<SdkError<DescribeFraudsterRegistrationJobError, R>> for Error
Source§fn from(err: SdkError<DescribeFraudsterRegistrationJobError, R>) -> Self
fn from(err: SdkError<DescribeFraudsterRegistrationJobError, R>) -> Self
Source§impl<R> From<SdkError<DescribeSpeakerEnrollmentJobError, R>> for Error
impl<R> From<SdkError<DescribeSpeakerEnrollmentJobError, R>> for Error
Source§fn from(err: SdkError<DescribeSpeakerEnrollmentJobError, R>) -> Self
fn from(err: SdkError<DescribeSpeakerEnrollmentJobError, R>) -> Self
Source§impl<R> From<SdkError<DescribeSpeakerError, R>> for Error
impl<R> From<SdkError<DescribeSpeakerError, R>> for Error
Source§fn from(err: SdkError<DescribeSpeakerError, R>) -> Self
fn from(err: SdkError<DescribeSpeakerError, R>) -> Self
Source§impl<R> From<SdkError<DescribeWatchlistError, R>> for Error
impl<R> From<SdkError<DescribeWatchlistError, R>> for Error
Source§fn from(err: SdkError<DescribeWatchlistError, R>) -> Self
fn from(err: SdkError<DescribeWatchlistError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateFraudsterError, R>> for Error
impl<R> From<SdkError<DisassociateFraudsterError, R>> for Error
Source§fn from(err: SdkError<DisassociateFraudsterError, R>) -> Self
fn from(err: SdkError<DisassociateFraudsterError, R>) -> Self
Source§impl<R> From<SdkError<EvaluateSessionError, R>> for Error
impl<R> From<SdkError<EvaluateSessionError, R>> for Error
Source§fn from(err: SdkError<EvaluateSessionError, R>) -> Self
fn from(err: SdkError<EvaluateSessionError, R>) -> Self
Source§impl<R> From<SdkError<ListDomainsError, R>> for Error
impl<R> From<SdkError<ListDomainsError, R>> for Error
Source§fn from(err: SdkError<ListDomainsError, R>) -> Self
fn from(err: SdkError<ListDomainsError, R>) -> Self
Source§impl<R> From<SdkError<ListFraudsterRegistrationJobsError, R>> for Error
impl<R> From<SdkError<ListFraudsterRegistrationJobsError, R>> for Error
Source§fn from(err: SdkError<ListFraudsterRegistrationJobsError, R>) -> Self
fn from(err: SdkError<ListFraudsterRegistrationJobsError, R>) -> Self
Source§impl<R> From<SdkError<ListFraudstersError, R>> for Error
impl<R> From<SdkError<ListFraudstersError, R>> for Error
Source§fn from(err: SdkError<ListFraudstersError, R>) -> Self
fn from(err: SdkError<ListFraudstersError, R>) -> Self
Source§impl<R> From<SdkError<ListSpeakerEnrollmentJobsError, R>> for Error
impl<R> From<SdkError<ListSpeakerEnrollmentJobsError, R>> for Error
Source§fn from(err: SdkError<ListSpeakerEnrollmentJobsError, R>) -> Self
fn from(err: SdkError<ListSpeakerEnrollmentJobsError, R>) -> Self
Source§impl<R> From<SdkError<ListSpeakersError, R>> for Error
impl<R> From<SdkError<ListSpeakersError, R>> for Error
Source§fn from(err: SdkError<ListSpeakersError, R>) -> Self
fn from(err: SdkError<ListSpeakersError, 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<ListWatchlistsError, R>> for Error
impl<R> From<SdkError<ListWatchlistsError, R>> for Error
Source§fn from(err: SdkError<ListWatchlistsError, R>) -> Self
fn from(err: SdkError<ListWatchlistsError, R>) -> Self
Source§impl<R> From<SdkError<OptOutSpeakerError, R>> for Error
impl<R> From<SdkError<OptOutSpeakerError, R>> for Error
Source§fn from(err: SdkError<OptOutSpeakerError, R>) -> Self
fn from(err: SdkError<OptOutSpeakerError, R>) -> Self
Source§impl<R> From<SdkError<StartFraudsterRegistrationJobError, R>> for Error
impl<R> From<SdkError<StartFraudsterRegistrationJobError, R>> for Error
Source§fn from(err: SdkError<StartFraudsterRegistrationJobError, R>) -> Self
fn from(err: SdkError<StartFraudsterRegistrationJobError, R>) -> Self
Source§impl<R> From<SdkError<StartSpeakerEnrollmentJobError, R>> for Error
impl<R> From<SdkError<StartSpeakerEnrollmentJobError, R>> for Error
Source§fn from(err: SdkError<StartSpeakerEnrollmentJobError, R>) -> Self
fn from(err: SdkError<StartSpeakerEnrollmentJobError, 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<UpdateDomainError, R>> for Error
impl<R> From<SdkError<UpdateDomainError, R>> for Error
Source§fn from(err: SdkError<UpdateDomainError, R>) -> Self
fn from(err: SdkError<UpdateDomainError, R>) -> Self
Source§impl<R> From<SdkError<UpdateWatchlistError, R>> for Error
impl<R> From<SdkError<UpdateWatchlistError, R>> for Error
Source§fn from(err: SdkError<UpdateWatchlistError, R>) -> Self
fn from(err: SdkError<UpdateWatchlistError, R>) -> Self
Source§impl From<StartFraudsterRegistrationJobError> for Error
impl From<StartFraudsterRegistrationJobError> for Error
Source§fn from(err: StartFraudsterRegistrationJobError) -> Self
fn from(err: StartFraudsterRegistrationJobError) -> Self
Source§impl From<StartSpeakerEnrollmentJobError> for Error
impl From<StartSpeakerEnrollmentJobError> for Error
Source§fn from(err: StartSpeakerEnrollmentJobError) -> Self
fn from(err: StartSpeakerEnrollmentJobError) -> 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<UpdateDomainError> for Error
impl From<UpdateDomainError> for Error
Source§fn from(err: UpdateDomainError) -> Self
fn from(err: UpdateDomainError) -> Self
Source§impl From<UpdateWatchlistError> for Error
impl From<UpdateWatchlistError> for Error
Source§fn from(err: UpdateWatchlistError) -> Self
fn from(err: UpdateWatchlistError) -> 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);