#[non_exhaustive]pub struct ServiceManagedEbsVolumeConfigurationBuilder { /* private fields */ }
Expand description
A builder for ServiceManagedEbsVolumeConfiguration
.
Implementations§
Source§impl ServiceManagedEbsVolumeConfigurationBuilder
impl ServiceManagedEbsVolumeConfigurationBuilder
Sourcepub fn encrypted(self, input: bool) -> Self
pub fn encrypted(self, input: bool) -> Self
Indicates whether the volume should be encrypted. If you turn on Region-level Amazon EBS encryption by default but set this value as false
, the setting is overridden and the volume is encrypted with the KMS key specified for Amazon EBS encryption by default. This parameter maps 1:1 with the Encrypted
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn set_encrypted(self, input: Option<bool>) -> Self
pub fn set_encrypted(self, input: Option<bool>) -> Self
Indicates whether the volume should be encrypted. If you turn on Region-level Amazon EBS encryption by default but set this value as false
, the setting is overridden and the volume is encrypted with the KMS key specified for Amazon EBS encryption by default. This parameter maps 1:1 with the Encrypted
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn get_encrypted(&self) -> &Option<bool>
pub fn get_encrypted(&self) -> &Option<bool>
Indicates whether the volume should be encrypted. If you turn on Region-level Amazon EBS encryption by default but set this value as false
, the setting is overridden and the volume is encrypted with the KMS key specified for Amazon EBS encryption by default. This parameter maps 1:1 with the Encrypted
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn kms_key_id(self, input: impl Into<String>) -> Self
pub fn kms_key_id(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) identifier of the Amazon Web Services Key Management Service key to use for Amazon EBS encryption. When a key is specified using this parameter, it overrides Amazon EBS default encryption or any KMS key that you specified for cluster-level managed storage encryption. This parameter maps 1:1 with the KmsKeyId
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information about encrypting Amazon EBS volumes attached to tasks, see Encrypt data stored in Amazon EBS volumes attached to Amazon ECS tasks.
Amazon Web Services authenticates the Amazon Web Services Key Management Service key asynchronously. Therefore, if you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails.
Sourcepub fn set_kms_key_id(self, input: Option<String>) -> Self
pub fn set_kms_key_id(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) identifier of the Amazon Web Services Key Management Service key to use for Amazon EBS encryption. When a key is specified using this parameter, it overrides Amazon EBS default encryption or any KMS key that you specified for cluster-level managed storage encryption. This parameter maps 1:1 with the KmsKeyId
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information about encrypting Amazon EBS volumes attached to tasks, see Encrypt data stored in Amazon EBS volumes attached to Amazon ECS tasks.
Amazon Web Services authenticates the Amazon Web Services Key Management Service key asynchronously. Therefore, if you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails.
Sourcepub fn get_kms_key_id(&self) -> &Option<String>
pub fn get_kms_key_id(&self) -> &Option<String>
The Amazon Resource Name (ARN) identifier of the Amazon Web Services Key Management Service key to use for Amazon EBS encryption. When a key is specified using this parameter, it overrides Amazon EBS default encryption or any KMS key that you specified for cluster-level managed storage encryption. This parameter maps 1:1 with the KmsKeyId
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information about encrypting Amazon EBS volumes attached to tasks, see Encrypt data stored in Amazon EBS volumes attached to Amazon ECS tasks.
Amazon Web Services authenticates the Amazon Web Services Key Management Service key asynchronously. Therefore, if you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails.
Sourcepub fn volume_type(self, input: impl Into<String>) -> Self
pub fn volume_type(self, input: impl Into<String>) -> Self
The volume type. This parameter maps 1:1 with the VolumeType
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide.
The following are the supported volume types.
-
General Purpose SSD:
gp2
|gp3
-
Provisioned IOPS SSD:
io1
|io2
-
Throughput Optimized HDD:
st1
-
Cold HDD:
sc1
-
Magnetic:
standard
The magnetic volume type is not supported on Fargate.
Sourcepub fn set_volume_type(self, input: Option<String>) -> Self
pub fn set_volume_type(self, input: Option<String>) -> Self
The volume type. This parameter maps 1:1 with the VolumeType
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide.
The following are the supported volume types.
-
General Purpose SSD:
gp2
|gp3
-
Provisioned IOPS SSD:
io1
|io2
-
Throughput Optimized HDD:
st1
-
Cold HDD:
sc1
-
Magnetic:
standard
The magnetic volume type is not supported on Fargate.
Sourcepub fn get_volume_type(&self) -> &Option<String>
pub fn get_volume_type(&self) -> &Option<String>
The volume type. This parameter maps 1:1 with the VolumeType
parameter of the CreateVolume API in the Amazon EC2 API Reference. For more information, see Amazon EBS volume types in the Amazon EC2 User Guide.
The following are the supported volume types.
-
General Purpose SSD:
gp2
|gp3
-
Provisioned IOPS SSD:
io1
|io2
-
Throughput Optimized HDD:
st1
-
Cold HDD:
sc1
-
Magnetic:
standard
The magnetic volume type is not supported on Fargate.
Sourcepub fn size_in_gib(self, input: i32) -> Self
pub fn size_in_gib(self, input: i32) -> Self
The size of the volume in GiB. You must specify either a volume size or a snapshot ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the Size
parameter of the CreateVolume API in the Amazon EC2 API Reference.
The following are the supported volume size values for each volume type.
-
gp2
andgp3
: 1-16,384 -
io1
andio2
: 4-16,384 -
st1
andsc1
: 125-16,384 -
standard
: 1-1,024
Sourcepub fn set_size_in_gib(self, input: Option<i32>) -> Self
pub fn set_size_in_gib(self, input: Option<i32>) -> Self
The size of the volume in GiB. You must specify either a volume size or a snapshot ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the Size
parameter of the CreateVolume API in the Amazon EC2 API Reference.
The following are the supported volume size values for each volume type.
-
gp2
andgp3
: 1-16,384 -
io1
andio2
: 4-16,384 -
st1
andsc1
: 125-16,384 -
standard
: 1-1,024
Sourcepub fn get_size_in_gib(&self) -> &Option<i32>
pub fn get_size_in_gib(&self) -> &Option<i32>
The size of the volume in GiB. You must specify either a volume size or a snapshot ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the Size
parameter of the CreateVolume API in the Amazon EC2 API Reference.
The following are the supported volume size values for each volume type.
-
gp2
andgp3
: 1-16,384 -
io1
andio2
: 4-16,384 -
st1
andsc1
: 125-16,384 -
standard
: 1-1,024
Sourcepub fn snapshot_id(self, input: impl Into<String>) -> Self
pub fn snapshot_id(self, input: impl Into<String>) -> Self
The snapshot that Amazon ECS uses to create volumes for attachment to tasks maintained by the service. You must specify either snapshotId
or sizeInGiB
in your volume configuration. This parameter maps 1:1 with the SnapshotId
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn set_snapshot_id(self, input: Option<String>) -> Self
pub fn set_snapshot_id(self, input: Option<String>) -> Self
The snapshot that Amazon ECS uses to create volumes for attachment to tasks maintained by the service. You must specify either snapshotId
or sizeInGiB
in your volume configuration. This parameter maps 1:1 with the SnapshotId
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn get_snapshot_id(&self) -> &Option<String>
pub fn get_snapshot_id(&self) -> &Option<String>
The snapshot that Amazon ECS uses to create volumes for attachment to tasks maintained by the service. You must specify either snapshotId
or sizeInGiB
in your volume configuration. This parameter maps 1:1 with the SnapshotId
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn volume_initialization_rate(self, input: i32) -> Self
pub fn volume_initialization_rate(self, input: i32) -> Self
The rate, in MiB/s, at which data is fetched from a snapshot of an existing EBS volume to create new volumes for attachment to the tasks maintained by the service. This property can be specified only if you specify a snapshotId
. For more information, see Initialize Amazon EBS volumes in the Amazon EBS User Guide.
Sourcepub fn set_volume_initialization_rate(self, input: Option<i32>) -> Self
pub fn set_volume_initialization_rate(self, input: Option<i32>) -> Self
The rate, in MiB/s, at which data is fetched from a snapshot of an existing EBS volume to create new volumes for attachment to the tasks maintained by the service. This property can be specified only if you specify a snapshotId
. For more information, see Initialize Amazon EBS volumes in the Amazon EBS User Guide.
Sourcepub fn get_volume_initialization_rate(&self) -> &Option<i32>
pub fn get_volume_initialization_rate(&self) -> &Option<i32>
The rate, in MiB/s, at which data is fetched from a snapshot of an existing EBS volume to create new volumes for attachment to the tasks maintained by the service. This property can be specified only if you specify a snapshotId
. For more information, see Initialize Amazon EBS volumes in the Amazon EBS User Guide.
Sourcepub fn iops(self, input: i32) -> Self
pub fn iops(self, input: i32) -> Self
The number of I/O operations per second (IOPS). For gp3
, io1
, and io2
volumes, this represents the number of IOPS that are provisioned for the volume. For gp2
volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
The following are the supported values for each volume type.
-
gp3
: 3,000 - 16,000 IOPS -
io1
: 100 - 64,000 IOPS -
io2
: 100 - 256,000 IOPS
This parameter is required for io1
and io2
volume types. The default for gp3
volumes is 3,000 IOPS
. This parameter is not supported for st1
, sc1
, or standard
volume types.
This parameter maps 1:1 with the Iops
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn set_iops(self, input: Option<i32>) -> Self
pub fn set_iops(self, input: Option<i32>) -> Self
The number of I/O operations per second (IOPS). For gp3
, io1
, and io2
volumes, this represents the number of IOPS that are provisioned for the volume. For gp2
volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
The following are the supported values for each volume type.
-
gp3
: 3,000 - 16,000 IOPS -
io1
: 100 - 64,000 IOPS -
io2
: 100 - 256,000 IOPS
This parameter is required for io1
and io2
volume types. The default for gp3
volumes is 3,000 IOPS
. This parameter is not supported for st1
, sc1
, or standard
volume types.
This parameter maps 1:1 with the Iops
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn get_iops(&self) -> &Option<i32>
pub fn get_iops(&self) -> &Option<i32>
The number of I/O operations per second (IOPS). For gp3
, io1
, and io2
volumes, this represents the number of IOPS that are provisioned for the volume. For gp2
volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.
The following are the supported values for each volume type.
-
gp3
: 3,000 - 16,000 IOPS -
io1
: 100 - 64,000 IOPS -
io2
: 100 - 256,000 IOPS
This parameter is required for io1
and io2
volume types. The default for gp3
volumes is 3,000 IOPS
. This parameter is not supported for st1
, sc1
, or standard
volume types.
This parameter maps 1:1 with the Iops
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn throughput(self, input: i32) -> Self
pub fn throughput(self, input: i32) -> Self
The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. This parameter maps 1:1 with the Throughput
parameter of the CreateVolume API in the Amazon EC2 API Reference.
This parameter is only supported for the gp3
volume type.
Sourcepub fn set_throughput(self, input: Option<i32>) -> Self
pub fn set_throughput(self, input: Option<i32>) -> Self
The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. This parameter maps 1:1 with the Throughput
parameter of the CreateVolume API in the Amazon EC2 API Reference.
This parameter is only supported for the gp3
volume type.
Sourcepub fn get_throughput(&self) -> &Option<i32>
pub fn get_throughput(&self) -> &Option<i32>
The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. This parameter maps 1:1 with the Throughput
parameter of the CreateVolume API in the Amazon EC2 API Reference.
This parameter is only supported for the gp3
volume type.
Sourcepub fn tag_specifications(self, input: EbsTagSpecification) -> Self
pub fn tag_specifications(self, input: EbsTagSpecification) -> Self
Appends an item to tag_specifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to apply to the volume. Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with the TagSpecifications.N
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn set_tag_specifications(
self,
input: Option<Vec<EbsTagSpecification>>,
) -> Self
pub fn set_tag_specifications( self, input: Option<Vec<EbsTagSpecification>>, ) -> Self
The tags to apply to the volume. Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with the TagSpecifications.N
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn get_tag_specifications(&self) -> &Option<Vec<EbsTagSpecification>>
pub fn get_tag_specifications(&self) -> &Option<Vec<EbsTagSpecification>>
The tags to apply to the volume. Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with the TagSpecifications.N
parameter of the CreateVolume API in the Amazon EC2 API Reference.
Sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The ARN of the IAM role to associate with this volume. This is the Amazon ECS infrastructure IAM role that is used to manage your Amazon Web Services infrastructure. We recommend using the Amazon ECS-managed AmazonECSInfrastructureRolePolicyForVolumes
IAM policy with this role. For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide.
Sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The ARN of the IAM role to associate with this volume. This is the Amazon ECS infrastructure IAM role that is used to manage your Amazon Web Services infrastructure. We recommend using the Amazon ECS-managed AmazonECSInfrastructureRolePolicyForVolumes
IAM policy with this role. For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide.
Sourcepub fn get_role_arn(&self) -> &Option<String>
pub fn get_role_arn(&self) -> &Option<String>
The ARN of the IAM role to associate with this volume. This is the Amazon ECS infrastructure IAM role that is used to manage your Amazon Web Services infrastructure. We recommend using the Amazon ECS-managed AmazonECSInfrastructureRolePolicyForVolumes
IAM policy with this role. For more information, see Amazon ECS infrastructure IAM role in the Amazon ECS Developer Guide.
Sourcepub fn filesystem_type(self, input: TaskFilesystemType) -> Self
pub fn filesystem_type(self, input: TaskFilesystemType) -> Self
The filesystem type for the volume. For volumes created from a snapshot, you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a filesystem type mismatch, the tasks will fail to start.
The available Linux filesystem types are
ext3
, ext4
, and xfs
. If no value is specified, the xfs
filesystem type is used by default.
The available Windows filesystem types are NTFS
.
Sourcepub fn set_filesystem_type(self, input: Option<TaskFilesystemType>) -> Self
pub fn set_filesystem_type(self, input: Option<TaskFilesystemType>) -> Self
The filesystem type for the volume. For volumes created from a snapshot, you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a filesystem type mismatch, the tasks will fail to start.
The available Linux filesystem types are
ext3
, ext4
, and xfs
. If no value is specified, the xfs
filesystem type is used by default.
The available Windows filesystem types are NTFS
.
Sourcepub fn get_filesystem_type(&self) -> &Option<TaskFilesystemType>
pub fn get_filesystem_type(&self) -> &Option<TaskFilesystemType>
The filesystem type for the volume. For volumes created from a snapshot, you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a filesystem type mismatch, the tasks will fail to start.
The available Linux filesystem types are
ext3
, ext4
, and xfs
. If no value is specified, the xfs
filesystem type is used by default.
The available Windows filesystem types are NTFS
.
Sourcepub fn build(self) -> Result<ServiceManagedEbsVolumeConfiguration, BuildError>
pub fn build(self) -> Result<ServiceManagedEbsVolumeConfiguration, BuildError>
Consumes the builder and constructs a ServiceManagedEbsVolumeConfiguration
.
This method will fail if any of the following fields are not set:
Trait Implementations§
Source§impl Clone for ServiceManagedEbsVolumeConfigurationBuilder
impl Clone for ServiceManagedEbsVolumeConfigurationBuilder
Source§fn clone(&self) -> ServiceManagedEbsVolumeConfigurationBuilder
fn clone(&self) -> ServiceManagedEbsVolumeConfigurationBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for ServiceManagedEbsVolumeConfigurationBuilder
impl Default for ServiceManagedEbsVolumeConfigurationBuilder
Source§fn default() -> ServiceManagedEbsVolumeConfigurationBuilder
fn default() -> ServiceManagedEbsVolumeConfigurationBuilder
Source§impl PartialEq for ServiceManagedEbsVolumeConfigurationBuilder
impl PartialEq for ServiceManagedEbsVolumeConfigurationBuilder
Source§fn eq(&self, other: &ServiceManagedEbsVolumeConfigurationBuilder) -> bool
fn eq(&self, other: &ServiceManagedEbsVolumeConfigurationBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ServiceManagedEbsVolumeConfigurationBuilder
Auto Trait Implementations§
impl Freeze for ServiceManagedEbsVolumeConfigurationBuilder
impl RefUnwindSafe for ServiceManagedEbsVolumeConfigurationBuilder
impl Send for ServiceManagedEbsVolumeConfigurationBuilder
impl Sync for ServiceManagedEbsVolumeConfigurationBuilder
impl Unpin for ServiceManagedEbsVolumeConfigurationBuilder
impl UnwindSafe for ServiceManagedEbsVolumeConfigurationBuilder
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);