#[non_exhaustive]pub enum Error {
ClusterLimitExceededException(ClusterLimitExceededException),
ConflictException(ConflictException),
Ec2RequestFailedException(Ec2RequestFailedException),
InvalidAddressException(InvalidAddressException),
InvalidInputCombinationException(InvalidInputCombinationException),
InvalidJobStateException(InvalidJobStateException),
InvalidNextTokenException(InvalidNextTokenException),
InvalidResourceException(InvalidResourceException),
KmsRequestFailedException(KmsRequestFailedException),
ReturnShippingLabelAlreadyExistsException(ReturnShippingLabelAlreadyExistsException),
UnsupportedAddressException(UnsupportedAddressException),
Unhandled(Unhandled),
}Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ClusterLimitExceededException(ClusterLimitExceededException)
Job creation failed. Currently, clusters support five nodes. If you have fewer than five nodes for your cluster and you have more nodes to create for this cluster, try again and create jobs until your cluster has exactly five nodes.
ConflictException(ConflictException)
You get this exception when you call CreateReturnShippingLabel more than once when other requests are not completed.
Ec2RequestFailedException(Ec2RequestFailedException)
Your user lacks the necessary Amazon EC2 permissions to perform the attempted action.
InvalidAddressException(InvalidAddressException)
The address provided was invalid. Check the address with your region's carrier, and try again.
InvalidInputCombinationException(InvalidInputCombinationException)
Job or cluster creation failed. One or more inputs were invalid. Confirm that the CreateClusterRequest$SnowballType value supports your CreateJobRequest$JobType, and try again.
InvalidJobStateException(InvalidJobStateException)
The action can't be performed because the job's current state doesn't allow that action to be performed.
InvalidNextTokenException(InvalidNextTokenException)
The NextToken string was altered unexpectedly, and the operation has stopped. Run the operation without changing the NextToken string, and try again.
InvalidResourceException(InvalidResourceException)
The specified resource can't be found. Check the information you provided in your last request, and try again.
KmsRequestFailedException(KmsRequestFailedException)
The provided Key Management Service key lacks the permissions to perform the specified CreateJob or UpdateJob action.
ReturnShippingLabelAlreadyExistsException(ReturnShippingLabelAlreadyExistsException)
You get this exception if you call CreateReturnShippingLabel and a valid return shipping label already exists. In this case, use DescribeReturnShippingLabel to get the URL.
UnsupportedAddressException(UnsupportedAddressException)
The address is either outside the serviceable area for your region, or an error occurred. Check the address with your region's carrier and try again. If the issue persists, contact Amazon Web Services Support.
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<CancelClusterError> for Error
impl From<CancelClusterError> for Error
Source§fn from(err: CancelClusterError) -> Self
fn from(err: CancelClusterError) -> Self
Source§impl From<CancelJobError> for Error
impl From<CancelJobError> for Error
Source§fn from(err: CancelJobError) -> Self
fn from(err: CancelJobError) -> Self
Source§impl From<CreateAddressError> for Error
impl From<CreateAddressError> for Error
Source§fn from(err: CreateAddressError) -> Self
fn from(err: CreateAddressError) -> Self
Source§impl From<CreateClusterError> for Error
impl From<CreateClusterError> for Error
Source§fn from(err: CreateClusterError) -> Self
fn from(err: CreateClusterError) -> Self
Source§impl From<CreateJobError> for Error
impl From<CreateJobError> for Error
Source§fn from(err: CreateJobError) -> Self
fn from(err: CreateJobError) -> Self
Source§impl From<CreateLongTermPricingError> for Error
impl From<CreateLongTermPricingError> for Error
Source§fn from(err: CreateLongTermPricingError) -> Self
fn from(err: CreateLongTermPricingError) -> Self
Source§impl From<CreateReturnShippingLabelError> for Error
impl From<CreateReturnShippingLabelError> for Error
Source§fn from(err: CreateReturnShippingLabelError) -> Self
fn from(err: CreateReturnShippingLabelError) -> Self
Source§impl From<DescribeAddressError> for Error
impl From<DescribeAddressError> for Error
Source§fn from(err: DescribeAddressError) -> Self
fn from(err: DescribeAddressError) -> Self
Source§impl From<DescribeAddressesError> for Error
impl From<DescribeAddressesError> for Error
Source§fn from(err: DescribeAddressesError) -> Self
fn from(err: DescribeAddressesError) -> Self
Source§impl From<DescribeClusterError> for Error
impl From<DescribeClusterError> for Error
Source§fn from(err: DescribeClusterError) -> Self
fn from(err: DescribeClusterError) -> Self
Source§impl From<DescribeJobError> for Error
impl From<DescribeJobError> for Error
Source§fn from(err: DescribeJobError) -> Self
fn from(err: DescribeJobError) -> Self
Source§impl From<DescribeReturnShippingLabelError> for Error
impl From<DescribeReturnShippingLabelError> for Error
Source§fn from(err: DescribeReturnShippingLabelError) -> Self
fn from(err: DescribeReturnShippingLabelError) -> Self
Source§impl From<GetJobManifestError> for Error
impl From<GetJobManifestError> for Error
Source§fn from(err: GetJobManifestError) -> Self
fn from(err: GetJobManifestError) -> Self
Source§impl From<GetJobUnlockCodeError> for Error
impl From<GetJobUnlockCodeError> for Error
Source§fn from(err: GetJobUnlockCodeError) -> Self
fn from(err: GetJobUnlockCodeError) -> Self
Source§impl From<GetSnowballUsageError> for Error
impl From<GetSnowballUsageError> for Error
Source§fn from(err: GetSnowballUsageError) -> Self
fn from(err: GetSnowballUsageError) -> Self
Source§impl From<GetSoftwareUpdatesError> for Error
impl From<GetSoftwareUpdatesError> for Error
Source§fn from(err: GetSoftwareUpdatesError) -> Self
fn from(err: GetSoftwareUpdatesError) -> Self
Source§impl From<ListClusterJobsError> for Error
impl From<ListClusterJobsError> for Error
Source§fn from(err: ListClusterJobsError) -> Self
fn from(err: ListClusterJobsError) -> Self
Source§impl From<ListClustersError> for Error
impl From<ListClustersError> for Error
Source§fn from(err: ListClustersError) -> Self
fn from(err: ListClustersError) -> Self
Source§impl From<ListCompatibleImagesError> for Error
impl From<ListCompatibleImagesError> for Error
Source§fn from(err: ListCompatibleImagesError) -> Self
fn from(err: ListCompatibleImagesError) -> Self
Source§impl From<ListJobsError> for Error
impl From<ListJobsError> for Error
Source§fn from(err: ListJobsError) -> Self
fn from(err: ListJobsError) -> Self
Source§impl From<ListLongTermPricingError> for Error
impl From<ListLongTermPricingError> for Error
Source§fn from(err: ListLongTermPricingError) -> Self
fn from(err: ListLongTermPricingError) -> Self
Source§impl From<ListPickupLocationsError> for Error
impl From<ListPickupLocationsError> for Error
Source§fn from(err: ListPickupLocationsError) -> Self
fn from(err: ListPickupLocationsError) -> Self
Source§impl From<ListServiceVersionsError> for Error
impl From<ListServiceVersionsError> for Error
Source§fn from(err: ListServiceVersionsError) -> Self
fn from(err: ListServiceVersionsError) -> Self
Source§impl<R> From<SdkError<CancelClusterError, R>> for Error
impl<R> From<SdkError<CancelClusterError, R>> for Error
Source§fn from(err: SdkError<CancelClusterError, R>) -> Self
fn from(err: SdkError<CancelClusterError, R>) -> Self
Source§impl<R> From<SdkError<CancelJobError, R>> for Error
impl<R> From<SdkError<CancelJobError, R>> for Error
Source§fn from(err: SdkError<CancelJobError, R>) -> Self
fn from(err: SdkError<CancelJobError, R>) -> Self
Source§impl<R> From<SdkError<CreateAddressError, R>> for Error
impl<R> From<SdkError<CreateAddressError, R>> for Error
Source§fn from(err: SdkError<CreateAddressError, R>) -> Self
fn from(err: SdkError<CreateAddressError, R>) -> Self
Source§impl<R> From<SdkError<CreateClusterError, R>> for Error
impl<R> From<SdkError<CreateClusterError, R>> for Error
Source§fn from(err: SdkError<CreateClusterError, R>) -> Self
fn from(err: SdkError<CreateClusterError, R>) -> Self
Source§impl<R> From<SdkError<CreateJobError, R>> for Error
impl<R> From<SdkError<CreateJobError, R>> for Error
Source§fn from(err: SdkError<CreateJobError, R>) -> Self
fn from(err: SdkError<CreateJobError, R>) -> Self
Source§impl<R> From<SdkError<CreateLongTermPricingError, R>> for Error
impl<R> From<SdkError<CreateLongTermPricingError, R>> for Error
Source§fn from(err: SdkError<CreateLongTermPricingError, R>) -> Self
fn from(err: SdkError<CreateLongTermPricingError, R>) -> Self
Source§impl<R> From<SdkError<CreateReturnShippingLabelError, R>> for Error
impl<R> From<SdkError<CreateReturnShippingLabelError, R>> for Error
Source§fn from(err: SdkError<CreateReturnShippingLabelError, R>) -> Self
fn from(err: SdkError<CreateReturnShippingLabelError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAddressError, R>> for Error
impl<R> From<SdkError<DescribeAddressError, R>> for Error
Source§fn from(err: SdkError<DescribeAddressError, R>) -> Self
fn from(err: SdkError<DescribeAddressError, R>) -> Self
Source§impl<R> From<SdkError<DescribeAddressesError, R>> for Error
impl<R> From<SdkError<DescribeAddressesError, R>> for Error
Source§fn from(err: SdkError<DescribeAddressesError, R>) -> Self
fn from(err: SdkError<DescribeAddressesError, R>) -> Self
Source§impl<R> From<SdkError<DescribeClusterError, R>> for Error
impl<R> From<SdkError<DescribeClusterError, R>> for Error
Source§fn from(err: SdkError<DescribeClusterError, R>) -> Self
fn from(err: SdkError<DescribeClusterError, R>) -> Self
Source§impl<R> From<SdkError<DescribeJobError, R>> for Error
impl<R> From<SdkError<DescribeJobError, R>> for Error
Source§fn from(err: SdkError<DescribeJobError, R>) -> Self
fn from(err: SdkError<DescribeJobError, R>) -> Self
Source§impl<R> From<SdkError<DescribeReturnShippingLabelError, R>> for Error
impl<R> From<SdkError<DescribeReturnShippingLabelError, R>> for Error
Source§fn from(err: SdkError<DescribeReturnShippingLabelError, R>) -> Self
fn from(err: SdkError<DescribeReturnShippingLabelError, R>) -> Self
Source§impl<R> From<SdkError<GetJobManifestError, R>> for Error
impl<R> From<SdkError<GetJobManifestError, R>> for Error
Source§fn from(err: SdkError<GetJobManifestError, R>) -> Self
fn from(err: SdkError<GetJobManifestError, R>) -> Self
Source§impl<R> From<SdkError<GetJobUnlockCodeError, R>> for Error
impl<R> From<SdkError<GetJobUnlockCodeError, R>> for Error
Source§fn from(err: SdkError<GetJobUnlockCodeError, R>) -> Self
fn from(err: SdkError<GetJobUnlockCodeError, R>) -> Self
Source§impl<R> From<SdkError<GetSnowballUsageError, R>> for Error
impl<R> From<SdkError<GetSnowballUsageError, R>> for Error
Source§fn from(err: SdkError<GetSnowballUsageError, R>) -> Self
fn from(err: SdkError<GetSnowballUsageError, R>) -> Self
Source§impl<R> From<SdkError<GetSoftwareUpdatesError, R>> for Error
impl<R> From<SdkError<GetSoftwareUpdatesError, R>> for Error
Source§fn from(err: SdkError<GetSoftwareUpdatesError, R>) -> Self
fn from(err: SdkError<GetSoftwareUpdatesError, R>) -> Self
Source§impl<R> From<SdkError<ListClusterJobsError, R>> for Error
impl<R> From<SdkError<ListClusterJobsError, R>> for Error
Source§fn from(err: SdkError<ListClusterJobsError, R>) -> Self
fn from(err: SdkError<ListClusterJobsError, R>) -> Self
Source§impl<R> From<SdkError<ListClustersError, R>> for Error
impl<R> From<SdkError<ListClustersError, R>> for Error
Source§fn from(err: SdkError<ListClustersError, R>) -> Self
fn from(err: SdkError<ListClustersError, R>) -> Self
Source§impl<R> From<SdkError<ListCompatibleImagesError, R>> for Error
impl<R> From<SdkError<ListCompatibleImagesError, R>> for Error
Source§fn from(err: SdkError<ListCompatibleImagesError, R>) -> Self
fn from(err: SdkError<ListCompatibleImagesError, R>) -> Self
Source§impl<R> From<SdkError<ListJobsError, R>> for Error
impl<R> From<SdkError<ListJobsError, R>> for Error
Source§fn from(err: SdkError<ListJobsError, R>) -> Self
fn from(err: SdkError<ListJobsError, R>) -> Self
Source§impl<R> From<SdkError<ListLongTermPricingError, R>> for Error
impl<R> From<SdkError<ListLongTermPricingError, R>> for Error
Source§fn from(err: SdkError<ListLongTermPricingError, R>) -> Self
fn from(err: SdkError<ListLongTermPricingError, R>) -> Self
Source§impl<R> From<SdkError<ListPickupLocationsError, R>> for Error
impl<R> From<SdkError<ListPickupLocationsError, R>> for Error
Source§fn from(err: SdkError<ListPickupLocationsError, R>) -> Self
fn from(err: SdkError<ListPickupLocationsError, R>) -> Self
Source§impl<R> From<SdkError<ListServiceVersionsError, R>> for Error
impl<R> From<SdkError<ListServiceVersionsError, R>> for Error
Source§fn from(err: SdkError<ListServiceVersionsError, R>) -> Self
fn from(err: SdkError<ListServiceVersionsError, R>) -> Self
Source§impl<R> From<SdkError<UpdateClusterError, R>> for Error
impl<R> From<SdkError<UpdateClusterError, R>> for Error
Source§fn from(err: SdkError<UpdateClusterError, R>) -> Self
fn from(err: SdkError<UpdateClusterError, R>) -> Self
Source§impl<R> From<SdkError<UpdateJobError, R>> for Error
impl<R> From<SdkError<UpdateJobError, R>> for Error
Source§fn from(err: SdkError<UpdateJobError, R>) -> Self
fn from(err: SdkError<UpdateJobError, R>) -> Self
Source§impl<R> From<SdkError<UpdateJobShipmentStateError, R>> for Error
impl<R> From<SdkError<UpdateJobShipmentStateError, R>> for Error
Source§fn from(err: SdkError<UpdateJobShipmentStateError, R>) -> Self
fn from(err: SdkError<UpdateJobShipmentStateError, R>) -> Self
Source§impl<R> From<SdkError<UpdateLongTermPricingError, R>> for Error
impl<R> From<SdkError<UpdateLongTermPricingError, R>> for Error
Source§fn from(err: SdkError<UpdateLongTermPricingError, R>) -> Self
fn from(err: SdkError<UpdateLongTermPricingError, R>) -> Self
Source§impl From<UpdateClusterError> for Error
impl From<UpdateClusterError> for Error
Source§fn from(err: UpdateClusterError) -> Self
fn from(err: UpdateClusterError) -> Self
Source§impl From<UpdateJobError> for Error
impl From<UpdateJobError> for Error
Source§fn from(err: UpdateJobError) -> Self
fn from(err: UpdateJobError) -> Self
Source§impl From<UpdateJobShipmentStateError> for Error
impl From<UpdateJobShipmentStateError> for Error
Source§fn from(err: UpdateJobShipmentStateError) -> Self
fn from(err: UpdateJobShipmentStateError) -> Self
Source§impl From<UpdateLongTermPricingError> for Error
impl From<UpdateLongTermPricingError> for Error
Source§fn from(err: UpdateLongTermPricingError) -> Self
fn from(err: UpdateLongTermPricingError) -> 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);