#[non_exhaustive]pub struct S3CopyObjectOperationBuilder { /* private fields */ }
Expand description
A builder for S3CopyObjectOperation
.
Implementations§
Source§impl S3CopyObjectOperationBuilder
impl S3CopyObjectOperationBuilder
Sourcepub fn target_resource(self, input: impl Into<String>) -> Self
pub fn target_resource(self, input: impl Into<String>) -> Self
Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
-
General purpose buckets - For example, to copy objects to a general purpose bucket named
destinationBucket
, set theTargetResource
property toarn:aws:s3:::destinationBucket
. -
Directory buckets - For example, to copy objects to a directory bucket named
destinationBucket
in the Availability Zone identified by the AZ IDusw2-az1
, set theTargetResource
property toarn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3
. A directory bucket as a destination bucket can be in Availability Zone or Local Zone.Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP
400 Bad Request
error with the error codeInvalidRequest
.
Sourcepub fn set_target_resource(self, input: Option<String>) -> Self
pub fn set_target_resource(self, input: Option<String>) -> Self
Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
-
General purpose buckets - For example, to copy objects to a general purpose bucket named
destinationBucket
, set theTargetResource
property toarn:aws:s3:::destinationBucket
. -
Directory buckets - For example, to copy objects to a directory bucket named
destinationBucket
in the Availability Zone identified by the AZ IDusw2-az1
, set theTargetResource
property toarn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3
. A directory bucket as a destination bucket can be in Availability Zone or Local Zone.Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP
400 Bad Request
error with the error codeInvalidRequest
.
Sourcepub fn get_target_resource(&self) -> &Option<String>
pub fn get_target_resource(&self) -> &Option<String>
Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.
-
General purpose buckets - For example, to copy objects to a general purpose bucket named
destinationBucket
, set theTargetResource
property toarn:aws:s3:::destinationBucket
. -
Directory buckets - For example, to copy objects to a directory bucket named
destinationBucket
in the Availability Zone identified by the AZ IDusw2-az1
, set theTargetResource
property toarn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3
. A directory bucket as a destination bucket can be in Availability Zone or Local Zone.Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP
400 Bad Request
error with the error codeInvalidRequest
.
Sourcepub fn canned_access_control_list(
self,
input: S3CannedAccessControlList,
) -> Self
pub fn canned_access_control_list( self, input: S3CannedAccessControlList, ) -> Self
This functionality is not supported by directory buckets.
Sourcepub fn set_canned_access_control_list(
self,
input: Option<S3CannedAccessControlList>,
) -> Self
pub fn set_canned_access_control_list( self, input: Option<S3CannedAccessControlList>, ) -> Self
This functionality is not supported by directory buckets.
Sourcepub fn get_canned_access_control_list(
&self,
) -> &Option<S3CannedAccessControlList>
pub fn get_canned_access_control_list( &self, ) -> &Option<S3CannedAccessControlList>
This functionality is not supported by directory buckets.
Sourcepub fn access_control_grants(self, input: S3Grant) -> Self
pub fn access_control_grants(self, input: S3Grant) -> Self
Appends an item to access_control_grants
.
To override the contents of this collection use set_access_control_grants
.
This functionality is not supported by directory buckets.
Sourcepub fn set_access_control_grants(self, input: Option<Vec<S3Grant>>) -> Self
pub fn set_access_control_grants(self, input: Option<Vec<S3Grant>>) -> Self
This functionality is not supported by directory buckets.
Sourcepub fn get_access_control_grants(&self) -> &Option<Vec<S3Grant>>
pub fn get_access_control_grants(&self) -> &Option<Vec<S3Grant>>
This functionality is not supported by directory buckets.
Sourcepub fn metadata_directive(self, input: S3MetadataDirective) -> Self
pub fn metadata_directive(self, input: S3MetadataDirective) -> Self
Sourcepub fn set_metadata_directive(self, input: Option<S3MetadataDirective>) -> Self
pub fn set_metadata_directive(self, input: Option<S3MetadataDirective>) -> Self
Sourcepub fn get_metadata_directive(&self) -> &Option<S3MetadataDirective>
pub fn get_metadata_directive(&self) -> &Option<S3MetadataDirective>
Sourcepub fn modified_since_constraint(self, input: DateTime) -> Self
pub fn modified_since_constraint(self, input: DateTime) -> Self
Sourcepub fn set_modified_since_constraint(self, input: Option<DateTime>) -> Self
pub fn set_modified_since_constraint(self, input: Option<DateTime>) -> Self
Sourcepub fn get_modified_since_constraint(&self) -> &Option<DateTime>
pub fn get_modified_since_constraint(&self) -> &Option<DateTime>
Sourcepub fn new_object_metadata(self, input: S3ObjectMetadata) -> Self
pub fn new_object_metadata(self, input: S3ObjectMetadata) -> Self
If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
Sourcepub fn set_new_object_metadata(self, input: Option<S3ObjectMetadata>) -> Self
pub fn set_new_object_metadata(self, input: Option<S3ObjectMetadata>) -> Self
If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
Sourcepub fn get_new_object_metadata(&self) -> &Option<S3ObjectMetadata>
pub fn get_new_object_metadata(&self) -> &Option<S3ObjectMetadata>
If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
Sourcepub fn new_object_tagging(self, input: S3Tag) -> Self
pub fn new_object_tagging(self, input: S3Tag) -> Self
Appends an item to new_object_tagging
.
To override the contents of this collection use set_new_object_tagging
.
Specifies a list of tags to add to the destination objects after they are copied. If NewObjectTagging
is not specified, the tags of the source objects are copied to destination objects by default.
Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging
field to prevent copying the source object tags to the directory bucket.
Sourcepub fn set_new_object_tagging(self, input: Option<Vec<S3Tag>>) -> Self
pub fn set_new_object_tagging(self, input: Option<Vec<S3Tag>>) -> Self
Specifies a list of tags to add to the destination objects after they are copied. If NewObjectTagging
is not specified, the tags of the source objects are copied to destination objects by default.
Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging
field to prevent copying the source object tags to the directory bucket.
Sourcepub fn get_new_object_tagging(&self) -> &Option<Vec<S3Tag>>
pub fn get_new_object_tagging(&self) -> &Option<Vec<S3Tag>>
Specifies a list of tags to add to the destination objects after they are copied. If NewObjectTagging
is not specified, the tags of the source objects are copied to destination objects by default.
Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging
field to prevent copying the source object tags to the directory bucket.
Sourcepub fn redirect_location(self, input: impl Into<String>) -> Self
pub fn redirect_location(self, input: impl Into<String>) -> Self
If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, x-amz-website-redirect-location
. Allows webpage redirects if the object copy is accessed through a website endpoint.
This functionality is not supported by directory buckets.
Sourcepub fn set_redirect_location(self, input: Option<String>) -> Self
pub fn set_redirect_location(self, input: Option<String>) -> Self
If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, x-amz-website-redirect-location
. Allows webpage redirects if the object copy is accessed through a website endpoint.
This functionality is not supported by directory buckets.
Sourcepub fn get_redirect_location(&self) -> &Option<String>
pub fn get_redirect_location(&self) -> &Option<String>
If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, x-amz-website-redirect-location
. Allows webpage redirects if the object copy is accessed through a website endpoint.
This functionality is not supported by directory buckets.
Sourcepub fn requester_pays(self, input: bool) -> Self
pub fn requester_pays(self, input: bool) -> Self
This functionality is not supported by directory buckets.
Sourcepub fn set_requester_pays(self, input: Option<bool>) -> Self
pub fn set_requester_pays(self, input: Option<bool>) -> Self
This functionality is not supported by directory buckets.
Sourcepub fn get_requester_pays(&self) -> &Option<bool>
pub fn get_requester_pays(&self) -> &Option<bool>
This functionality is not supported by directory buckets.
Sourcepub fn storage_class(self, input: S3StorageClass) -> Self
pub fn storage_class(self, input: S3StorageClass) -> Self
Specify the storage class for the destination objects in a Copy
operation.
Directory buckets - This functionality is not supported by directory buckets.
Sourcepub fn set_storage_class(self, input: Option<S3StorageClass>) -> Self
pub fn set_storage_class(self, input: Option<S3StorageClass>) -> Self
Specify the storage class for the destination objects in a Copy
operation.
Directory buckets - This functionality is not supported by directory buckets.
Sourcepub fn get_storage_class(&self) -> &Option<S3StorageClass>
pub fn get_storage_class(&self) -> &Option<S3StorageClass>
Specify the storage class for the destination objects in a Copy
operation.
Directory buckets - This functionality is not supported by directory buckets.
Sourcepub fn un_modified_since_constraint(self, input: DateTime) -> Self
pub fn un_modified_since_constraint(self, input: DateTime) -> Self
Sourcepub fn set_un_modified_since_constraint(self, input: Option<DateTime>) -> Self
pub fn set_un_modified_since_constraint(self, input: Option<DateTime>) -> Self
Sourcepub fn get_un_modified_since_constraint(&self) -> &Option<DateTime>
pub fn get_un_modified_since_constraint(&self) -> &Option<DateTime>
Sourcepub fn sse_aws_kms_key_id(self, input: impl Into<String>) -> Self
pub fn sse_aws_kms_key_id(self, input: impl Into<String>) -> Self
Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.
Directory buckets - If you specify SSEAlgorithm
with KMS
, you must specify the SSEAwsKmsKeyId
parameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request
error. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key (aws/s3
) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.
Sourcepub fn set_sse_aws_kms_key_id(self, input: Option<String>) -> Self
pub fn set_sse_aws_kms_key_id(self, input: Option<String>) -> Self
Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.
Directory buckets - If you specify SSEAlgorithm
with KMS
, you must specify the SSEAwsKmsKeyId
parameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request
error. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key (aws/s3
) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.
Sourcepub fn get_sse_aws_kms_key_id(&self) -> &Option<String>
pub fn get_sse_aws_kms_key_id(&self) -> &Option<String>
Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.
Directory buckets - If you specify SSEAlgorithm
with KMS
, you must specify the SSEAwsKmsKeyId
parameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request
error. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key (aws/s3
) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.
Sourcepub fn target_key_prefix(self, input: impl Into<String>) -> Self
pub fn target_key_prefix(self, input: impl Into<String>) -> Self
Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named Folder1
in the destination bucket, set the TargetKeyPrefix
property to Folder1
.
Sourcepub fn set_target_key_prefix(self, input: Option<String>) -> Self
pub fn set_target_key_prefix(self, input: Option<String>) -> Self
Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named Folder1
in the destination bucket, set the TargetKeyPrefix
property to Folder1
.
Sourcepub fn get_target_key_prefix(&self) -> &Option<String>
pub fn get_target_key_prefix(&self) -> &Option<String>
Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named Folder1
in the destination bucket, set the TargetKeyPrefix
property to Folder1
.
Sourcepub fn object_lock_legal_hold_status(
self,
input: S3ObjectLockLegalHoldStatus,
) -> Self
pub fn object_lock_legal_hold_status( self, input: S3ObjectLockLegalHoldStatus, ) -> Self
The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn set_object_lock_legal_hold_status(
self,
input: Option<S3ObjectLockLegalHoldStatus>,
) -> Self
pub fn set_object_lock_legal_hold_status( self, input: Option<S3ObjectLockLegalHoldStatus>, ) -> Self
The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn get_object_lock_legal_hold_status(
&self,
) -> &Option<S3ObjectLockLegalHoldStatus>
pub fn get_object_lock_legal_hold_status( &self, ) -> &Option<S3ObjectLockLegalHoldStatus>
The legal hold status to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn object_lock_mode(self, input: S3ObjectLockMode) -> Self
pub fn object_lock_mode(self, input: S3ObjectLockMode) -> Self
The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn set_object_lock_mode(self, input: Option<S3ObjectLockMode>) -> Self
pub fn set_object_lock_mode(self, input: Option<S3ObjectLockMode>) -> Self
The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn get_object_lock_mode(&self) -> &Option<S3ObjectLockMode>
pub fn get_object_lock_mode(&self) -> &Option<S3ObjectLockMode>
The retention mode to be applied to all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn object_lock_retain_until_date(self, input: DateTime) -> Self
pub fn object_lock_retain_until_date(self, input: DateTime) -> Self
The date when the applied object retention configuration expires on all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn set_object_lock_retain_until_date(self, input: Option<DateTime>) -> Self
pub fn set_object_lock_retain_until_date(self, input: Option<DateTime>) -> Self
The date when the applied object retention configuration expires on all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn get_object_lock_retain_until_date(&self) -> &Option<DateTime>
pub fn get_object_lock_retain_until_date(&self) -> &Option<DateTime>
The date when the applied object retention configuration expires on all objects in the Batch Operations job.
This functionality is not supported by directory buckets.
Sourcepub fn bucket_key_enabled(self, input: bool) -> Self
pub fn bucket_key_enabled(self, input: bool) -> Self
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
Specifying this header with an Copy action doesn’t affect bucket-level settings for S3 Bucket Key.
Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
Sourcepub fn set_bucket_key_enabled(self, input: Option<bool>) -> Self
pub fn set_bucket_key_enabled(self, input: Option<bool>) -> Self
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
Specifying this header with an Copy action doesn’t affect bucket-level settings for S3 Bucket Key.
Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
Sourcepub fn get_bucket_key_enabled(&self) -> &Option<bool>
pub fn get_bucket_key_enabled(&self) -> &Option<bool>
Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true
causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
Specifying this header with an Copy action doesn’t affect bucket-level settings for S3 Bucket Key.
Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.
Sourcepub fn checksum_algorithm(self, input: S3ChecksumAlgorithm) -> Self
pub fn checksum_algorithm(self, input: S3ChecksumAlgorithm) -> Self
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
Sourcepub fn set_checksum_algorithm(self, input: Option<S3ChecksumAlgorithm>) -> Self
pub fn set_checksum_algorithm(self, input: Option<S3ChecksumAlgorithm>) -> Self
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
Sourcepub fn get_checksum_algorithm(&self) -> &Option<S3ChecksumAlgorithm>
pub fn get_checksum_algorithm(&self) -> &Option<S3ChecksumAlgorithm>
Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
Sourcepub fn build(self) -> S3CopyObjectOperation
pub fn build(self) -> S3CopyObjectOperation
Consumes the builder and constructs a S3CopyObjectOperation
.
Trait Implementations§
Source§impl Clone for S3CopyObjectOperationBuilder
impl Clone for S3CopyObjectOperationBuilder
Source§fn clone(&self) -> S3CopyObjectOperationBuilder
fn clone(&self) -> S3CopyObjectOperationBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for S3CopyObjectOperationBuilder
impl Debug for S3CopyObjectOperationBuilder
Source§impl Default for S3CopyObjectOperationBuilder
impl Default for S3CopyObjectOperationBuilder
Source§fn default() -> S3CopyObjectOperationBuilder
fn default() -> S3CopyObjectOperationBuilder
Source§impl PartialEq for S3CopyObjectOperationBuilder
impl PartialEq for S3CopyObjectOperationBuilder
Source§fn eq(&self, other: &S3CopyObjectOperationBuilder) -> bool
fn eq(&self, other: &S3CopyObjectOperationBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for S3CopyObjectOperationBuilder
Auto Trait Implementations§
impl Freeze for S3CopyObjectOperationBuilder
impl RefUnwindSafe for S3CopyObjectOperationBuilder
impl Send for S3CopyObjectOperationBuilder
impl Sync for S3CopyObjectOperationBuilder
impl Unpin for S3CopyObjectOperationBuilder
impl UnwindSafe for S3CopyObjectOperationBuilder
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);