#[non_exhaustive]pub struct RefreshPreferencesBuilder { /* private fields */ }
Expand description
A builder for RefreshPreferences
.
Implementations§
Source§impl RefreshPreferencesBuilder
impl RefreshPreferencesBuilder
Sourcepub fn min_healthy_percentage(self, input: i32) -> Self
pub fn min_healthy_percentage(self, input: i32) -> Self
Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload to allow the operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 0 to 100.
If you do not specify this property, the default is 90 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn set_min_healthy_percentage(self, input: Option<i32>) -> Self
pub fn set_min_healthy_percentage(self, input: Option<i32>) -> Self
Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload to allow the operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 0 to 100.
If you do not specify this property, the default is 90 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn get_min_healthy_percentage(&self) -> &Option<i32>
pub fn get_min_healthy_percentage(&self) -> &Option<i32>
Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload to allow the operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 0 to 100.
If you do not specify this property, the default is 90 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn instance_warmup(self, input: i32) -> Self
pub fn instance_warmup(self, input: i32) -> Self
A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters the InService
state.
This property is not required for normal usage. Instead, use the DefaultInstanceWarmup
property of the Auto Scaling group. The InstanceWarmup
and DefaultInstanceWarmup
properties work the same way. Only specify this property if you must override the DefaultInstanceWarmup
property.
If you do not specify this property, the instance warmup by default is the value of the DefaultInstanceWarmup
property, if defined (which is recommended in all cases), or the HealthCheckGracePeriod
property otherwise.
Sourcepub fn set_instance_warmup(self, input: Option<i32>) -> Self
pub fn set_instance_warmup(self, input: Option<i32>) -> Self
A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters the InService
state.
This property is not required for normal usage. Instead, use the DefaultInstanceWarmup
property of the Auto Scaling group. The InstanceWarmup
and DefaultInstanceWarmup
properties work the same way. Only specify this property if you must override the DefaultInstanceWarmup
property.
If you do not specify this property, the instance warmup by default is the value of the DefaultInstanceWarmup
property, if defined (which is recommended in all cases), or the HealthCheckGracePeriod
property otherwise.
Sourcepub fn get_instance_warmup(&self) -> &Option<i32>
pub fn get_instance_warmup(&self) -> &Option<i32>
A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters the InService
state.
This property is not required for normal usage. Instead, use the DefaultInstanceWarmup
property of the Auto Scaling group. The InstanceWarmup
and DefaultInstanceWarmup
properties work the same way. Only specify this property if you must override the DefaultInstanceWarmup
property.
If you do not specify this property, the instance warmup by default is the value of the DefaultInstanceWarmup
property, if defined (which is recommended in all cases), or the HealthCheckGracePeriod
property otherwise.
Sourcepub fn checkpoint_percentages(self, input: i32) -> Self
pub fn checkpoint_percentages(self, input: i32) -> Self
Appends an item to checkpoint_percentages
.
To override the contents of this collection use set_checkpoint_percentages
.
(Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the Auto Scaling group, the last number in the array must be 100
.
For usage examples, see Add checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn set_checkpoint_percentages(self, input: Option<Vec<i32>>) -> Self
pub fn set_checkpoint_percentages(self, input: Option<Vec<i32>>) -> Self
(Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the Auto Scaling group, the last number in the array must be 100
.
For usage examples, see Add checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn get_checkpoint_percentages(&self) -> &Option<Vec<i32>>
pub fn get_checkpoint_percentages(&self) -> &Option<Vec<i32>>
(Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the Auto Scaling group, the last number in the array must be 100
.
For usage examples, see Add checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn checkpoint_delay(self, input: i32) -> Self
pub fn checkpoint_delay(self, input: i32) -> Self
(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is optional, but if you specify a value for it, you must also specify a value for CheckpointPercentages
. If you specify a value for CheckpointPercentages
and not for CheckpointDelay
, the CheckpointDelay
defaults to 3600
(1 hour).
Sourcepub fn set_checkpoint_delay(self, input: Option<i32>) -> Self
pub fn set_checkpoint_delay(self, input: Option<i32>) -> Self
(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is optional, but if you specify a value for it, you must also specify a value for CheckpointPercentages
. If you specify a value for CheckpointPercentages
and not for CheckpointDelay
, the CheckpointDelay
defaults to 3600
(1 hour).
Sourcepub fn get_checkpoint_delay(&self) -> &Option<i32>
pub fn get_checkpoint_delay(&self) -> &Option<i32>
(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is optional, but if you specify a value for it, you must also specify a value for CheckpointPercentages
. If you specify a value for CheckpointPercentages
and not for CheckpointDelay
, the CheckpointDelay
defaults to 3600
(1 hour).
Sourcepub fn skip_matching(self, input: bool) -> Self
pub fn skip_matching(self, input: bool) -> Self
(Optional) Indicates whether skip matching is enabled. If enabled (true
), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default is false
.
For more information, see Use an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn set_skip_matching(self, input: Option<bool>) -> Self
pub fn set_skip_matching(self, input: Option<bool>) -> Self
(Optional) Indicates whether skip matching is enabled. If enabled (true
), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default is false
.
For more information, see Use an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn get_skip_matching(&self) -> &Option<bool>
pub fn get_skip_matching(&self) -> &Option<bool>
(Optional) Indicates whether skip matching is enabled. If enabled (true
), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default is false
.
For more information, see Use an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn auto_rollback(self, input: bool) -> Self
pub fn auto_rollback(self, input: bool) -> Self
(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails or a CloudWatch alarm threshold is met. The default is false
.
A rollback is not supported in the following situations:
-
There is no desired configuration specified for the instance refresh.
-
The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the
ImageId
property. -
The Auto Scaling group uses the launch template's
$Latest
or$Default
version.
For more information, see Undo changes with a rollback in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn set_auto_rollback(self, input: Option<bool>) -> Self
pub fn set_auto_rollback(self, input: Option<bool>) -> Self
(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails or a CloudWatch alarm threshold is met. The default is false
.
A rollback is not supported in the following situations:
-
There is no desired configuration specified for the instance refresh.
-
The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the
ImageId
property. -
The Auto Scaling group uses the launch template's
$Latest
or$Default
version.
For more information, see Undo changes with a rollback in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn get_auto_rollback(&self) -> &Option<bool>
pub fn get_auto_rollback(&self) -> &Option<bool>
(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails or a CloudWatch alarm threshold is met. The default is false
.
A rollback is not supported in the following situations:
-
There is no desired configuration specified for the instance refresh.
-
The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the
ImageId
property. -
The Auto Scaling group uses the launch template's
$Latest
or$Default
version.
For more information, see Undo changes with a rollback in the Amazon EC2 Auto Scaling User Guide.
Sourcepub fn scale_in_protected_instances(
self,
input: ScaleInProtectedInstances,
) -> Self
pub fn scale_in_protected_instances( self, input: ScaleInProtectedInstances, ) -> Self
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
Sourcepub fn set_scale_in_protected_instances(
self,
input: Option<ScaleInProtectedInstances>,
) -> Self
pub fn set_scale_in_protected_instances( self, input: Option<ScaleInProtectedInstances>, ) -> Self
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
Sourcepub fn get_scale_in_protected_instances(
&self,
) -> &Option<ScaleInProtectedInstances>
pub fn get_scale_in_protected_instances( &self, ) -> &Option<ScaleInProtectedInstances>
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
Sourcepub fn standby_instances(self, input: StandbyInstances) -> Self
pub fn standby_instances(self, input: StandbyInstances) -> Self
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in Standby
state are found.
The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
Sourcepub fn set_standby_instances(self, input: Option<StandbyInstances>) -> Self
pub fn set_standby_instances(self, input: Option<StandbyInstances>) -> Self
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in Standby
state are found.
The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
Sourcepub fn get_standby_instances(&self) -> &Option<StandbyInstances>
pub fn get_standby_instances(&self) -> &Option<StandbyInstances>
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in Standby
state are found.
The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
Sourcepub fn alarm_specification(self, input: AlarmSpecification) -> Self
pub fn alarm_specification(self, input: AlarmSpecification) -> Self
(Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.
Sourcepub fn set_alarm_specification(self, input: Option<AlarmSpecification>) -> Self
pub fn set_alarm_specification(self, input: Option<AlarmSpecification>) -> Self
(Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.
Sourcepub fn get_alarm_specification(&self) -> &Option<AlarmSpecification>
pub fn get_alarm_specification(&self) -> &Option<AlarmSpecification>
(Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.
Sourcepub fn max_healthy_percentage(self, input: i32) -> Self
pub fn max_healthy_percentage(self, input: i32) -> Self
Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 100 to 200.
If you specify MaxHealthyPercentage
, you must also specify MinHealthyPercentage
, and the difference between them cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.
If you do not specify this property, the default is 100 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn set_max_healthy_percentage(self, input: Option<i32>) -> Self
pub fn set_max_healthy_percentage(self, input: Option<i32>) -> Self
Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 100 to 200.
If you specify MaxHealthyPercentage
, you must also specify MinHealthyPercentage
, and the difference between them cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.
If you do not specify this property, the default is 100 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn get_max_healthy_percentage(&self) -> &Option<i32>
pub fn get_max_healthy_percentage(&self) -> &Option<i32>
Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 100 to 200.
If you specify MaxHealthyPercentage
, you must also specify MinHealthyPercentage
, and the difference between them cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.
If you do not specify this property, the default is 100 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
Sourcepub fn bake_time(self, input: i32) -> Self
pub fn bake_time(self, input: i32) -> Self
The amount of time, in seconds, to wait at the end of an instance refresh before the instance refresh is considered complete.
Sourcepub fn set_bake_time(self, input: Option<i32>) -> Self
pub fn set_bake_time(self, input: Option<i32>) -> Self
The amount of time, in seconds, to wait at the end of an instance refresh before the instance refresh is considered complete.
Sourcepub fn get_bake_time(&self) -> &Option<i32>
pub fn get_bake_time(&self) -> &Option<i32>
The amount of time, in seconds, to wait at the end of an instance refresh before the instance refresh is considered complete.
Sourcepub fn build(self) -> RefreshPreferences
pub fn build(self) -> RefreshPreferences
Consumes the builder and constructs a RefreshPreferences
.
Trait Implementations§
Source§impl Clone for RefreshPreferencesBuilder
impl Clone for RefreshPreferencesBuilder
Source§fn clone(&self) -> RefreshPreferencesBuilder
fn clone(&self) -> RefreshPreferencesBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RefreshPreferencesBuilder
impl Debug for RefreshPreferencesBuilder
Source§impl Default for RefreshPreferencesBuilder
impl Default for RefreshPreferencesBuilder
Source§fn default() -> RefreshPreferencesBuilder
fn default() -> RefreshPreferencesBuilder
impl StructuralPartialEq for RefreshPreferencesBuilder
Auto Trait Implementations§
impl Freeze for RefreshPreferencesBuilder
impl RefUnwindSafe for RefreshPreferencesBuilder
impl Send for RefreshPreferencesBuilder
impl Sync for RefreshPreferencesBuilder
impl Unpin for RefreshPreferencesBuilder
impl UnwindSafe for RefreshPreferencesBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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);