#[non_exhaustive]pub struct CreateOntapVolumeConfigurationBuilder { /* private fields */ }
Expand description
A builder for CreateOntapVolumeConfiguration
.
Implementations§
Source§impl CreateOntapVolumeConfigurationBuilder
impl CreateOntapVolumeConfigurationBuilder
Sourcepub fn junction_path(self, input: impl Into<String>) -> Self
pub fn junction_path(self, input: impl Into<String>) -> Self
Specifies the location in the SVM's namespace where the volume is mounted. This parameter is required. The JunctionPath
must have a leading forward slash, such as /vol3
.
Sourcepub fn set_junction_path(self, input: Option<String>) -> Self
pub fn set_junction_path(self, input: Option<String>) -> Self
Specifies the location in the SVM's namespace where the volume is mounted. This parameter is required. The JunctionPath
must have a leading forward slash, such as /vol3
.
Sourcepub fn get_junction_path(&self) -> &Option<String>
pub fn get_junction_path(&self) -> &Option<String>
Specifies the location in the SVM's namespace where the volume is mounted. This parameter is required. The JunctionPath
must have a leading forward slash, such as /vol3
.
Sourcepub fn security_style(self, input: SecurityStyle) -> Self
pub fn security_style(self, input: SecurityStyle) -> Self
Specifies the security style for the volume. If a volume's security style is not specified, it is automatically set to the root volume's security style. The security style determines the type of permissions that FSx for ONTAP uses to control data access. Specify one of the following values:
-
UNIX
if the file system is managed by a UNIX administrator, the majority of users are NFS clients, and an application accessing the data uses a UNIX user as the service account. -
NTFS
if the file system is managed by a Windows administrator, the majority of users are SMB clients, and an application accessing the data uses a Windows user as the service account. -
MIXED
This is an advanced setting. For more information, see the topic What the security styles and their effects are in the NetApp Documentation Center.
For more information, see Volume security style in the FSx for ONTAP User Guide.
Sourcepub fn set_security_style(self, input: Option<SecurityStyle>) -> Self
pub fn set_security_style(self, input: Option<SecurityStyle>) -> Self
Specifies the security style for the volume. If a volume's security style is not specified, it is automatically set to the root volume's security style. The security style determines the type of permissions that FSx for ONTAP uses to control data access. Specify one of the following values:
-
UNIX
if the file system is managed by a UNIX administrator, the majority of users are NFS clients, and an application accessing the data uses a UNIX user as the service account. -
NTFS
if the file system is managed by a Windows administrator, the majority of users are SMB clients, and an application accessing the data uses a Windows user as the service account. -
MIXED
This is an advanced setting. For more information, see the topic What the security styles and their effects are in the NetApp Documentation Center.
For more information, see Volume security style in the FSx for ONTAP User Guide.
Sourcepub fn get_security_style(&self) -> &Option<SecurityStyle>
pub fn get_security_style(&self) -> &Option<SecurityStyle>
Specifies the security style for the volume. If a volume's security style is not specified, it is automatically set to the root volume's security style. The security style determines the type of permissions that FSx for ONTAP uses to control data access. Specify one of the following values:
-
UNIX
if the file system is managed by a UNIX administrator, the majority of users are NFS clients, and an application accessing the data uses a UNIX user as the service account. -
NTFS
if the file system is managed by a Windows administrator, the majority of users are SMB clients, and an application accessing the data uses a Windows user as the service account. -
MIXED
This is an advanced setting. For more information, see the topic What the security styles and their effects are in the NetApp Documentation Center.
For more information, see Volume security style in the FSx for ONTAP User Guide.
Sourcepub fn size_in_megabytes(self, input: i32) -> Self
👎Deprecated: This property is deprecated, use SizeInBytes instead
pub fn size_in_megabytes(self, input: i32) -> Self
Use SizeInBytes
instead. Specifies the size of the volume, in megabytes (MB), that you are creating.
Sourcepub fn set_size_in_megabytes(self, input: Option<i32>) -> Self
👎Deprecated: This property is deprecated, use SizeInBytes instead
pub fn set_size_in_megabytes(self, input: Option<i32>) -> Self
Use SizeInBytes
instead. Specifies the size of the volume, in megabytes (MB), that you are creating.
Sourcepub fn get_size_in_megabytes(&self) -> &Option<i32>
👎Deprecated: This property is deprecated, use SizeInBytes instead
pub fn get_size_in_megabytes(&self) -> &Option<i32>
Use SizeInBytes
instead. Specifies the size of the volume, in megabytes (MB), that you are creating.
Sourcepub fn storage_efficiency_enabled(self, input: bool) -> Self
pub fn storage_efficiency_enabled(self, input: bool) -> Self
Set to true to enable deduplication, compression, and compaction storage efficiency features on the volume, or set to false to disable them.
StorageEfficiencyEnabled
is required when creating a RW
volume (OntapVolumeType
set to RW
).
Sourcepub fn set_storage_efficiency_enabled(self, input: Option<bool>) -> Self
pub fn set_storage_efficiency_enabled(self, input: Option<bool>) -> Self
Set to true to enable deduplication, compression, and compaction storage efficiency features on the volume, or set to false to disable them.
StorageEfficiencyEnabled
is required when creating a RW
volume (OntapVolumeType
set to RW
).
Sourcepub fn get_storage_efficiency_enabled(&self) -> &Option<bool>
pub fn get_storage_efficiency_enabled(&self) -> &Option<bool>
Set to true to enable deduplication, compression, and compaction storage efficiency features on the volume, or set to false to disable them.
StorageEfficiencyEnabled
is required when creating a RW
volume (OntapVolumeType
set to RW
).
Sourcepub fn storage_virtual_machine_id(self, input: impl Into<String>) -> Self
pub fn storage_virtual_machine_id(self, input: impl Into<String>) -> Self
Specifies the ONTAP SVM in which to create the volume.
This field is required.Sourcepub fn set_storage_virtual_machine_id(self, input: Option<String>) -> Self
pub fn set_storage_virtual_machine_id(self, input: Option<String>) -> Self
Specifies the ONTAP SVM in which to create the volume.
Sourcepub fn get_storage_virtual_machine_id(&self) -> &Option<String>
pub fn get_storage_virtual_machine_id(&self) -> &Option<String>
Specifies the ONTAP SVM in which to create the volume.
Sourcepub fn tiering_policy(self, input: TieringPolicy) -> Self
pub fn tiering_policy(self, input: TieringPolicy) -> Self
Describes the data tiering policy for an ONTAP volume. When enabled, Amazon FSx for ONTAP's intelligent tiering automatically transitions a volume's data between the file system's primary storage and capacity pool storage based on your access patterns.
Valid tiering policies are the following:
-
SNAPSHOT_ONLY
- (Default value) moves cold snapshots to the capacity pool storage tier.
-
AUTO
- moves cold user data and snapshots to the capacity pool storage tier based on your access patterns.
-
ALL
- moves all user data blocks in both the active file system and Snapshot copies to the storage pool tier.
-
NONE
- keeps a volume's data in the primary storage tier, preventing it from being moved to the capacity pool tier.
Sourcepub fn set_tiering_policy(self, input: Option<TieringPolicy>) -> Self
pub fn set_tiering_policy(self, input: Option<TieringPolicy>) -> Self
Describes the data tiering policy for an ONTAP volume. When enabled, Amazon FSx for ONTAP's intelligent tiering automatically transitions a volume's data between the file system's primary storage and capacity pool storage based on your access patterns.
Valid tiering policies are the following:
-
SNAPSHOT_ONLY
- (Default value) moves cold snapshots to the capacity pool storage tier.
-
AUTO
- moves cold user data and snapshots to the capacity pool storage tier based on your access patterns.
-
ALL
- moves all user data blocks in both the active file system and Snapshot copies to the storage pool tier.
-
NONE
- keeps a volume's data in the primary storage tier, preventing it from being moved to the capacity pool tier.
Sourcepub fn get_tiering_policy(&self) -> &Option<TieringPolicy>
pub fn get_tiering_policy(&self) -> &Option<TieringPolicy>
Describes the data tiering policy for an ONTAP volume. When enabled, Amazon FSx for ONTAP's intelligent tiering automatically transitions a volume's data between the file system's primary storage and capacity pool storage based on your access patterns.
Valid tiering policies are the following:
-
SNAPSHOT_ONLY
- (Default value) moves cold snapshots to the capacity pool storage tier.
-
AUTO
- moves cold user data and snapshots to the capacity pool storage tier based on your access patterns.
-
ALL
- moves all user data blocks in both the active file system and Snapshot copies to the storage pool tier.
-
NONE
- keeps a volume's data in the primary storage tier, preventing it from being moved to the capacity pool tier.
Sourcepub fn ontap_volume_type(self, input: InputOntapVolumeType) -> Self
pub fn ontap_volume_type(self, input: InputOntapVolumeType) -> Self
Specifies the type of volume you are creating. Valid values are the following:
-
RW
specifies a read/write volume.RW
is the default. -
DP
specifies a data-protection volume. ADP
volume is read-only and can be used as the destination of a NetApp SnapMirror relationship.
For more information, see Volume types in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn set_ontap_volume_type(self, input: Option<InputOntapVolumeType>) -> Self
pub fn set_ontap_volume_type(self, input: Option<InputOntapVolumeType>) -> Self
Specifies the type of volume you are creating. Valid values are the following:
-
RW
specifies a read/write volume.RW
is the default. -
DP
specifies a data-protection volume. ADP
volume is read-only and can be used as the destination of a NetApp SnapMirror relationship.
For more information, see Volume types in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn get_ontap_volume_type(&self) -> &Option<InputOntapVolumeType>
pub fn get_ontap_volume_type(&self) -> &Option<InputOntapVolumeType>
Specifies the type of volume you are creating. Valid values are the following:
-
RW
specifies a read/write volume.RW
is the default. -
DP
specifies a data-protection volume. ADP
volume is read-only and can be used as the destination of a NetApp SnapMirror relationship.
For more information, see Volume types in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn snapshot_policy(self, input: impl Into<String>) -> Self
pub fn snapshot_policy(self, input: impl Into<String>) -> Self
Specifies the snapshot policy for the volume. There are three built-in snapshot policies:
-
default
: This is the default policy. A maximum of six hourly snapshots taken five minutes past the hour. A maximum of two daily snapshots taken Monday through Saturday at 10 minutes after midnight. A maximum of two weekly snapshots taken every Sunday at 15 minutes after midnight. -
default-1weekly
: This policy is the same as thedefault
policy except that it only retains one snapshot from the weekly schedule. -
none
: This policy does not take any snapshots. This policy can be assigned to volumes to prevent automatic snapshots from being taken.
You can also provide the name of a custom policy that you created with the ONTAP CLI or REST API.
For more information, see Snapshot policies in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn set_snapshot_policy(self, input: Option<String>) -> Self
pub fn set_snapshot_policy(self, input: Option<String>) -> Self
Specifies the snapshot policy for the volume. There are three built-in snapshot policies:
-
default
: This is the default policy. A maximum of six hourly snapshots taken five minutes past the hour. A maximum of two daily snapshots taken Monday through Saturday at 10 minutes after midnight. A maximum of two weekly snapshots taken every Sunday at 15 minutes after midnight. -
default-1weekly
: This policy is the same as thedefault
policy except that it only retains one snapshot from the weekly schedule. -
none
: This policy does not take any snapshots. This policy can be assigned to volumes to prevent automatic snapshots from being taken.
You can also provide the name of a custom policy that you created with the ONTAP CLI or REST API.
For more information, see Snapshot policies in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn get_snapshot_policy(&self) -> &Option<String>
pub fn get_snapshot_policy(&self) -> &Option<String>
Specifies the snapshot policy for the volume. There are three built-in snapshot policies:
-
default
: This is the default policy. A maximum of six hourly snapshots taken five minutes past the hour. A maximum of two daily snapshots taken Monday through Saturday at 10 minutes after midnight. A maximum of two weekly snapshots taken every Sunday at 15 minutes after midnight. -
default-1weekly
: This policy is the same as thedefault
policy except that it only retains one snapshot from the weekly schedule. -
none
: This policy does not take any snapshots. This policy can be assigned to volumes to prevent automatic snapshots from being taken.
You can also provide the name of a custom policy that you created with the ONTAP CLI or REST API.
For more information, see Snapshot policies in the Amazon FSx for NetApp ONTAP User Guide.
A boolean flag indicating whether tags for the volume should be copied to backups. This value defaults to false. If it's set to true, all tags for the volume are copied to all automatic and user-initiated backups where the user doesn't specify tags. If this value is true, and you specify one or more tags, only the specified tags are copied to backups. If you specify one or more tags when creating a user-initiated backup, no tags are copied from the volume, regardless of this value.
A boolean flag indicating whether tags for the volume should be copied to backups. This value defaults to false. If it's set to true, all tags for the volume are copied to all automatic and user-initiated backups where the user doesn't specify tags. If this value is true, and you specify one or more tags, only the specified tags are copied to backups. If you specify one or more tags when creating a user-initiated backup, no tags are copied from the volume, regardless of this value.
A boolean flag indicating whether tags for the volume should be copied to backups. This value defaults to false. If it's set to true, all tags for the volume are copied to all automatic and user-initiated backups where the user doesn't specify tags. If this value is true, and you specify one or more tags, only the specified tags are copied to backups. If you specify one or more tags when creating a user-initiated backup, no tags are copied from the volume, regardless of this value.
Sourcepub fn snaplock_configuration(self, input: CreateSnaplockConfiguration) -> Self
pub fn snaplock_configuration(self, input: CreateSnaplockConfiguration) -> Self
Specifies the SnapLock configuration for an FSx for ONTAP volume.
Sourcepub fn set_snaplock_configuration(
self,
input: Option<CreateSnaplockConfiguration>,
) -> Self
pub fn set_snaplock_configuration( self, input: Option<CreateSnaplockConfiguration>, ) -> Self
Specifies the SnapLock configuration for an FSx for ONTAP volume.
Sourcepub fn get_snaplock_configuration(&self) -> &Option<CreateSnaplockConfiguration>
pub fn get_snaplock_configuration(&self) -> &Option<CreateSnaplockConfiguration>
Specifies the SnapLock configuration for an FSx for ONTAP volume.
Sourcepub fn volume_style(self, input: VolumeStyle) -> Self
pub fn volume_style(self, input: VolumeStyle) -> Self
Use to specify the style of an ONTAP volume. FSx for ONTAP offers two styles of volumes that you can use for different purposes, FlexVol and FlexGroup volumes. For more information, see Volume styles in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn set_volume_style(self, input: Option<VolumeStyle>) -> Self
pub fn set_volume_style(self, input: Option<VolumeStyle>) -> Self
Use to specify the style of an ONTAP volume. FSx for ONTAP offers two styles of volumes that you can use for different purposes, FlexVol and FlexGroup volumes. For more information, see Volume styles in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn get_volume_style(&self) -> &Option<VolumeStyle>
pub fn get_volume_style(&self) -> &Option<VolumeStyle>
Use to specify the style of an ONTAP volume. FSx for ONTAP offers two styles of volumes that you can use for different purposes, FlexVol and FlexGroup volumes. For more information, see Volume styles in the Amazon FSx for NetApp ONTAP User Guide.
Sourcepub fn aggregate_configuration(
self,
input: CreateAggregateConfiguration,
) -> Self
pub fn aggregate_configuration( self, input: CreateAggregateConfiguration, ) -> Self
Use to specify configuration options for a volume’s storage aggregate or aggregates.
Sourcepub fn set_aggregate_configuration(
self,
input: Option<CreateAggregateConfiguration>,
) -> Self
pub fn set_aggregate_configuration( self, input: Option<CreateAggregateConfiguration>, ) -> Self
Use to specify configuration options for a volume’s storage aggregate or aggregates.
Sourcepub fn get_aggregate_configuration(
&self,
) -> &Option<CreateAggregateConfiguration>
pub fn get_aggregate_configuration( &self, ) -> &Option<CreateAggregateConfiguration>
Use to specify configuration options for a volume’s storage aggregate or aggregates.
Sourcepub fn size_in_bytes(self, input: i64) -> Self
pub fn size_in_bytes(self, input: i64) -> Self
Specifies the configured size of the volume, in bytes.
Sourcepub fn set_size_in_bytes(self, input: Option<i64>) -> Self
pub fn set_size_in_bytes(self, input: Option<i64>) -> Self
Specifies the configured size of the volume, in bytes.
Sourcepub fn get_size_in_bytes(&self) -> &Option<i64>
pub fn get_size_in_bytes(&self) -> &Option<i64>
Specifies the configured size of the volume, in bytes.
Sourcepub fn build(self) -> CreateOntapVolumeConfiguration
pub fn build(self) -> CreateOntapVolumeConfiguration
Consumes the builder and constructs a CreateOntapVolumeConfiguration
.
Trait Implementations§
Source§impl Clone for CreateOntapVolumeConfigurationBuilder
impl Clone for CreateOntapVolumeConfigurationBuilder
Source§fn clone(&self) -> CreateOntapVolumeConfigurationBuilder
fn clone(&self) -> CreateOntapVolumeConfigurationBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for CreateOntapVolumeConfigurationBuilder
impl Default for CreateOntapVolumeConfigurationBuilder
Source§fn default() -> CreateOntapVolumeConfigurationBuilder
fn default() -> CreateOntapVolumeConfigurationBuilder
Source§impl PartialEq for CreateOntapVolumeConfigurationBuilder
impl PartialEq for CreateOntapVolumeConfigurationBuilder
Source§fn eq(&self, other: &CreateOntapVolumeConfigurationBuilder) -> bool
fn eq(&self, other: &CreateOntapVolumeConfigurationBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CreateOntapVolumeConfigurationBuilder
Auto Trait Implementations§
impl Freeze for CreateOntapVolumeConfigurationBuilder
impl RefUnwindSafe for CreateOntapVolumeConfigurationBuilder
impl Send for CreateOntapVolumeConfigurationBuilder
impl Sync for CreateOntapVolumeConfigurationBuilder
impl Unpin for CreateOntapVolumeConfigurationBuilder
impl UnwindSafe for CreateOntapVolumeConfigurationBuilder
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);