pub struct CopyImageFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to CopyImage
.
Initiates an AMI copy operation. You must specify the source AMI ID and both the source and destination locations. The copy operation must be initiated in the destination Region.
CopyImage supports the following source to destination copies:
-
Region to Region
-
Region to Outpost
-
Parent Region to Local Zone
-
Local Zone to parent Region
-
Between Local Zones with the same parent Region (only supported for certain Local Zones)
CopyImage does not support the following source to destination copies:
-
Local Zone to non-parent Regions
-
Between Local Zones with different parent Regions
-
Local Zone to Outpost
-
Outpost to Local Zone
-
Outpost to Region
-
Between Outposts
-
Within same Outpost
-
Cross-partition copies (use CreateStoreImageTask instead)
Destination specification
-
Region to Region: The destination Region is the Region in which you initiate the copy operation.
-
Region to Outpost: Specify the destination using the
DestinationOutpostArn
parameter (the ARN of the Outpost) -
Region to Local Zone, and Local Zone to Local Zone copies: Specify the destination using the
DestinationAvailabilityZone
parameter (the name of the destination Local Zone) orDestinationAvailabilityZoneId
parameter (the ID of the destination Local Zone).
Snapshot encryption
-
Region to Outpost: Backing snapshots copied to an Outpost are encrypted by default using the default encryption key for the Region or the key that you specify. Outposts do not support unencrypted snapshots.
-
Region to Local Zone, and Local Zone to Local Zone: Not all Local Zones require encrypted snapshots. In Local Zones that require encrypted snapshots, backing snapshots are automatically encrypted during copy. In Local Zones where encryption is not required, snapshots retain their original encryption state (encrypted or unencrypted) by default.
For more information, including the required permissions for copying an AMI, see Copy an Amazon EC2 AMI in the Amazon EC2 User Guide.
Implementations§
Source§impl CopyImageFluentBuilder
impl CopyImageFluentBuilder
Sourcepub fn as_input(&self) -> &CopyImageInputBuilder
pub fn as_input(&self) -> &CopyImageInputBuilder
Access the CopyImage as a reference.
Sourcepub async fn send(
self,
) -> Result<CopyImageOutput, SdkError<CopyImageError, HttpResponse>>
pub async fn send( self, ) -> Result<CopyImageOutput, SdkError<CopyImageError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<CopyImageOutput, CopyImageError, Self>
pub fn customize( self, ) -> CustomizableOperation<CopyImageOutput, CopyImageError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in Amazon EC2 API requests in the Amazon EC2 API Reference.
Sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in Amazon EC2 API requests in the Amazon EC2 API Reference.
Sourcepub fn get_client_token(&self) -> &Option<String>
pub fn get_client_token(&self) -> &Option<String>
Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in Amazon EC2 API requests in the Amazon EC2 API Reference.
Sourcepub fn description(self, input: impl Into<String>) -> Self
pub fn description(self, input: impl Into<String>) -> Self
A description for the new AMI.
Sourcepub fn set_description(self, input: Option<String>) -> Self
pub fn set_description(self, input: Option<String>) -> Self
A description for the new AMI.
Sourcepub fn get_description(&self) -> &Option<String>
pub fn get_description(&self) -> &Option<String>
A description for the new AMI.
Sourcepub fn encrypted(self, input: bool) -> Self
pub fn encrypted(self, input: bool) -> Self
Specifies whether to encrypt the snapshots of the copied image.
You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using KmsKeyId
. For more information, see Use encryption with EBS-backed AMIs in the Amazon EC2 User Guide.
Sourcepub fn set_encrypted(self, input: Option<bool>) -> Self
pub fn set_encrypted(self, input: Option<bool>) -> Self
Specifies whether to encrypt the snapshots of the copied image.
You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using KmsKeyId
. For more information, see Use encryption with EBS-backed AMIs in the Amazon EC2 User Guide.
Sourcepub fn get_encrypted(&self) -> &Option<bool>
pub fn get_encrypted(&self) -> &Option<bool>
Specifies whether to encrypt the snapshots of the copied image.
You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default KMS key for Amazon EBS is used unless you specify a non-default Key Management Service (KMS) KMS key using KmsKeyId
. For more information, see Use encryption with EBS-backed AMIs in the Amazon EC2 User Guide.
Sourcepub fn kms_key_id(self, input: impl Into<String>) -> Self
pub fn kms_key_id(self, input: impl Into<String>) -> Self
The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to true
.
You can specify a KMS key using any of the following:
-
Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
-
Key alias. For example, alias/ExampleAlias.
-
Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
-
Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.
The specified KMS key must exist in the destination Region.
Amazon EBS does not support asymmetric KMS keys.
Sourcepub fn set_kms_key_id(self, input: Option<String>) -> Self
pub fn set_kms_key_id(self, input: Option<String>) -> Self
The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to true
.
You can specify a KMS key using any of the following:
-
Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
-
Key alias. For example, alias/ExampleAlias.
-
Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
-
Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.
The specified KMS key must exist in the destination Region.
Amazon EBS does not support asymmetric KMS keys.
Sourcepub fn get_kms_key_id(&self) -> &Option<String>
pub fn get_kms_key_id(&self) -> &Option<String>
The identifier of the symmetric Key Management Service (KMS) KMS key to use when creating encrypted volumes. If this parameter is not specified, your Amazon Web Services managed KMS key for Amazon EBS is used. If you specify a KMS key, you must also set the encrypted state to true
.
You can specify a KMS key using any of the following:
-
Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
-
Key alias. For example, alias/ExampleAlias.
-
Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
-
Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an identifier that is not valid, the action can appear to complete, but eventually fails.
The specified KMS key must exist in the destination Region.
Amazon EBS does not support asymmetric KMS keys.
Sourcepub fn source_image_id(self, input: impl Into<String>) -> Self
pub fn source_image_id(self, input: impl Into<String>) -> Self
The ID of the AMI to copy.
Sourcepub fn set_source_image_id(self, input: Option<String>) -> Self
pub fn set_source_image_id(self, input: Option<String>) -> Self
The ID of the AMI to copy.
Sourcepub fn get_source_image_id(&self) -> &Option<String>
pub fn get_source_image_id(&self) -> &Option<String>
The ID of the AMI to copy.
Sourcepub fn source_region(self, input: impl Into<String>) -> Self
pub fn source_region(self, input: impl Into<String>) -> Self
The name of the Region that contains the AMI to copy.
Sourcepub fn set_source_region(self, input: Option<String>) -> Self
pub fn set_source_region(self, input: Option<String>) -> Self
The name of the Region that contains the AMI to copy.
Sourcepub fn get_source_region(&self) -> &Option<String>
pub fn get_source_region(&self) -> &Option<String>
The name of the Region that contains the AMI to copy.
Sourcepub fn destination_outpost_arn(self, input: impl Into<String>) -> Self
pub fn destination_outpost_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the Outpost for the new AMI.
Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.
For more information, see Copy AMIs from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn set_destination_outpost_arn(self, input: Option<String>) -> Self
pub fn set_destination_outpost_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the Outpost for the new AMI.
Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.
For more information, see Copy AMIs from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn get_destination_outpost_arn(&self) -> &Option<String>
pub fn get_destination_outpost_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the Outpost for the new AMI.
Only specify this parameter when copying an AMI from an Amazon Web Services Region to an Outpost. The AMI must be in the Region of the destination Outpost. You can't copy an AMI from an Outpost to a Region, from one Outpost to another, or within the same Outpost.
For more information, see Copy AMIs from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Specifies whether to copy your user-defined AMI tags to the new AMI.
The following tags are not be copied:
-
System tags (prefixed with
aws:
) -
For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts
Default: Your user-defined AMI tags are not copied.
Specifies whether to copy your user-defined AMI tags to the new AMI.
The following tags are not be copied:
-
System tags (prefixed with
aws:
) -
For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts
Default: Your user-defined AMI tags are not copied.
Specifies whether to copy your user-defined AMI tags to the new AMI.
The following tags are not be copied:
-
System tags (prefixed with
aws:
) -
For public and shared AMIs, user-defined tags that are attached by other Amazon Web Services accounts
Default: Your user-defined AMI tags are not copied.
Sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to TagSpecifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.
-
To tag the new AMI, the value for
ResourceType
must beimage
. -
To tag the new snapshots, the value for
ResourceType
must besnapshot
. The same tag is applied to all the new snapshots.
If you specify other values for ResourceType
, the request fails.
To tag an AMI or snapshot after it has been created, see CreateTags.
Sourcepub fn set_tag_specifications(
self,
input: Option<Vec<TagSpecification>>,
) -> Self
pub fn set_tag_specifications( self, input: Option<Vec<TagSpecification>>, ) -> Self
The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.
-
To tag the new AMI, the value for
ResourceType
must beimage
. -
To tag the new snapshots, the value for
ResourceType
must besnapshot
. The same tag is applied to all the new snapshots.
If you specify other values for ResourceType
, the request fails.
To tag an AMI or snapshot after it has been created, see CreateTags.
Sourcepub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
pub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
The tags to apply to the new AMI and new snapshots. You can tag the AMI, the snapshots, or both.
-
To tag the new AMI, the value for
ResourceType
must beimage
. -
To tag the new snapshots, the value for
ResourceType
must besnapshot
. The same tag is applied to all the new snapshots.
If you specify other values for ResourceType
, the request fails.
To tag an AMI or snapshot after it has been created, see CreateTags.
Sourcepub fn snapshot_copy_completion_duration_minutes(self, input: i64) -> Self
pub fn snapshot_copy_completion_duration_minutes(self, input: i64) -> Self
Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.
If you do not specify a value, the AMI copy operation is completed on a best-effort basis.
This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.
For more information, see Time-based copies for Amazon EBS snapshots and EBS-backed AMIs.
Sourcepub fn set_snapshot_copy_completion_duration_minutes(
self,
input: Option<i64>,
) -> Self
pub fn set_snapshot_copy_completion_duration_minutes( self, input: Option<i64>, ) -> Self
Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.
If you do not specify a value, the AMI copy operation is completed on a best-effort basis.
This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.
For more information, see Time-based copies for Amazon EBS snapshots and EBS-backed AMIs.
Sourcepub fn get_snapshot_copy_completion_duration_minutes(&self) -> &Option<i64>
pub fn get_snapshot_copy_completion_duration_minutes(&self) -> &Option<i64>
Specify a completion duration, in 15 minute increments, to initiate a time-based AMI copy. The specified completion duration applies to each of the snapshots associated with the AMI. Each snapshot associated with the AMI will be completed within the specified completion duration, with copy throughput automatically adjusted for each snapshot based on its size to meet the timing target.
If you do not specify a value, the AMI copy operation is completed on a best-effort basis.
This parameter is not supported when copying an AMI to or from a Local Zone, or to an Outpost.
For more information, see Time-based copies for Amazon EBS snapshots and EBS-backed AMIs.
Sourcepub fn destination_availability_zone(self, input: impl Into<String>) -> Self
pub fn destination_availability_zone(self, input: impl Into<String>) -> Self
The Local Zone for the new AMI (for example, cn-north-1-pkx-1a
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn set_destination_availability_zone(self, input: Option<String>) -> Self
pub fn set_destination_availability_zone(self, input: Option<String>) -> Self
The Local Zone for the new AMI (for example, cn-north-1-pkx-1a
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn get_destination_availability_zone(&self) -> &Option<String>
pub fn get_destination_availability_zone(&self) -> &Option<String>
The Local Zone for the new AMI (for example, cn-north-1-pkx-1a
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn destination_availability_zone_id(self, input: impl Into<String>) -> Self
pub fn destination_availability_zone_id(self, input: impl Into<String>) -> Self
The ID of the Local Zone for the new AMI (for example, cnn1-pkx1-az1
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn set_destination_availability_zone_id(self, input: Option<String>) -> Self
pub fn set_destination_availability_zone_id(self, input: Option<String>) -> Self
The ID of the Local Zone for the new AMI (for example, cnn1-pkx1-az1
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn get_destination_availability_zone_id(&self) -> &Option<String>
pub fn get_destination_availability_zone_id(&self) -> &Option<String>
The ID of the Local Zone for the new AMI (for example, cnn1-pkx1-az1
).
Only one of DestinationAvailabilityZone
, DestinationAvailabilityZoneId
, or DestinationOutpostArn
can be specified.
Sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Sourcepub fn get_dry_run(&self) -> &Option<bool>
pub fn get_dry_run(&self) -> &Option<bool>
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Trait Implementations§
Source§impl Clone for CopyImageFluentBuilder
impl Clone for CopyImageFluentBuilder
Source§fn clone(&self) -> CopyImageFluentBuilder
fn clone(&self) -> CopyImageFluentBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CopyImageFluentBuilder
impl !RefUnwindSafe for CopyImageFluentBuilder
impl Send for CopyImageFluentBuilder
impl Sync for CopyImageFluentBuilder
impl Unpin for CopyImageFluentBuilder
impl !UnwindSafe for CopyImageFluentBuilder
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);