pub struct Client { /* private fields */ }Expand description
Client for Amazon Elastic File System
Client for invoking operations on Amazon Elastic File System. Each operation on Amazon Elastic File System is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env() instead, which returns a ConfigLoader that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_efs::Client::new(&config);Occasionally, SDKs may have additional service-specific values that can be set on the Config that
is absent from SdkConfig, or slightly different settings for a specific client may be desired.
The Builder struct implements From<&SdkConfig>, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_efs::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();See the aws-config docs and Config for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateAccessPoint operation has
a Client::create_access_point, function which returns a builder for that operation.
The fluent builder ultimately has a send() function that returns an async future that
returns a result, as illustrated below:
let result = client.create_access_point()
.client_token("example")
.send()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_access_point(&self) -> CreateAccessPointFluentBuilder
pub fn create_access_point(&self) -> CreateAccessPointFluentBuilder
Constructs a fluent builder for the CreateAccessPoint operation.
- The fluent builder is configurable:
client_token(impl Into<String>)/set_client_token(Option<String>):
required: trueA string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.
tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: falseCreates tags associated with the access point. Each tag is a key-value pair, each key must be unique. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the EFS file system that the access point provides access to.
posix_user(PosixUser)/set_posix_user(Option<PosixUser>):
required: falseThe operating system user and group applied to all file system requests made using the access point.
root_directory(RootDirectory)/set_root_directory(Option<RootDirectory>):
required: falseSpecifies the directory on the EFS file system that the access point exposes as the root directory of your file system to NFS clients using the access point. The clients using the access point can only access the root directory and below. If the
RootDirectory>Pathspecified does not exist, Amazon EFS creates it and applies theCreationInfosettings when a client connects to an access point. When specifying aRootDirectory, you must provide thePath, and theCreationInfo.Amazon EFS creates a root directory only if you have provided the CreationInfo: OwnUid, OwnGID, and permissions for the directory. If you do not provide this information, Amazon EFS does not create the root directory. If the root directory does not exist, attempts to mount using the access point will fail.
- On success, responds with
CreateAccessPointOutputwith field(s):client_token(Option<String>):The opaque string specified in the request to ensure idempotent creation.
name(Option<String>):The name of the access point. This is the value of the
Nametag.tags(Option<Vec::<Tag>>):The tags associated with the access point, presented as an array of Tag objects.
access_point_id(Option<String>):The ID of the access point, assigned by Amazon EFS.
access_point_arn(Option<String>):The unique Amazon Resource Name (ARN) associated with the access point.
file_system_id(Option<String>):The ID of the EFS file system that the access point applies to.
posix_user(Option<PosixUser>):The full POSIX identity, including the user ID, group ID, and secondary group IDs on the access point that is used for all file operations by NFS clients using the access point.
root_directory(Option<RootDirectory>):The directory on the EFS file system that the access point exposes as the root directory to NFS clients using the access point.
owner_id(Option<String>):Identifies the Amazon Web Services account that owns the access point resource.
life_cycle_state(Option<LifeCycleState>):Identifies the lifecycle phase of the access point.
- On failure, responds with
SdkError<CreateAccessPointError>
Source§impl Client
impl Client
Sourcepub fn create_file_system(&self) -> CreateFileSystemFluentBuilder
pub fn create_file_system(&self) -> CreateFileSystemFluentBuilder
Constructs a fluent builder for the CreateFileSystem operation.
- The fluent builder is configurable:
creation_token(impl Into<String>)/set_creation_token(Option<String>):
required: trueA string of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent creation.
performance_mode(PerformanceMode)/set_performance_mode(Option<PerformanceMode>):
required: falseThe performance mode of the file system. We recommend
generalPurposeperformance mode for all file systems. File systems using themaxIOperformance mode can scale to higher levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most file operations. The performance mode can’t be changed after the file system has been created. ThemaxIOmode is not supported on One Zone file systems.Due to the higher per-operation latencies with Max I/O, we recommend using General Purpose performance mode for all file systems.
Default is
generalPurpose.encrypted(bool)/set_encrypted(Option<bool>):
required: falseA Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have the option of specifying an existing Key Management Service key (KMS key). If you don’t specify a KMS key, then the default KMS key for Amazon EFS,
/aws/elasticfilesystem, is used to protect the encrypted file system.kms_key_id(impl Into<String>)/set_kms_key_id(Option<String>):
required: falseThe ID of the KMS key that you want to use to protect the encrypted file system. This parameter is required only if you want to use a non-default KMS key. If this parameter is not specified, the default KMS key for Amazon EFS is used. You can specify a KMS key ID using the following formats:
-
Key ID - A unique identifier of the key, for example
1234abcd-12ab-34cd-56ef-1234567890ab. -
ARN - An Amazon Resource Name (ARN) for the key, for example
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. -
Key alias - A previously created display name for a key, for example
alias/projectKey1. -
Key alias ARN - An ARN for a key alias, for example
arn:aws:kms:us-west-2:444455556666:alias/projectKey1.
If you use
KmsKeyId, you must set theCreateFileSystemRequest$Encryptedparameter to true.EFS accepts only symmetric KMS keys. You cannot use asymmetric KMS keys with Amazon EFS file systems.
-
throughput_mode(ThroughputMode)/set_throughput_mode(Option<ThroughputMode>):
required: falseSpecifies the throughput mode for the file system. The mode can be
bursting,provisioned, orelastic. If you setThroughputModetoprovisioned, you must also set a value forProvisionedThroughputInMibps. After you create the file system, you can decrease your file system’s Provisioned throughput or change between the throughput modes, with certain time restrictions. For more information, see Specifying throughput with provisioned mode in the Amazon EFS User Guide.Default is
bursting.provisioned_throughput_in_mibps(f64)/set_provisioned_throughput_in_mibps(Option<f64>):
required: falseThe throughput, measured in mebibytes per second (MiBps), that you want to provision for a file system that you’re creating. Required if
ThroughputModeis set toprovisioned. Valid values are 1-3414 MiBps, with the upper limit depending on Region. To increase this limit, contact Amazon Web ServicesSupport. For more information, see Amazon EFS quotas that you can increase in the Amazon EFS User Guide.availability_zone_name(impl Into<String>)/set_availability_zone_name(Option<String>):
required: falseFor One Zone file systems, specify the Amazon Web Services Availability Zone in which to create the file system. Use the format
us-east-1ato specify the Availability Zone. For more information about One Zone file systems, see EFS file system types in the Amazon EFS User Guide.One Zone file systems are not available in all Availability Zones in Amazon Web Services Regions where Amazon EFS is available.
backup(bool)/set_backup(Option<bool>):
required: falseSpecifies whether automatic backups are enabled on the file system that you are creating. Set the value to
trueto enable automatic backups. If you are creating a One Zone file system, automatic backups are enabled by default. For more information, see Automatic backups in the Amazon EFS User Guide.Default is
false. However, if you specify anAvailabilityZoneName, the default istrue.Backup is not available in all Amazon Web Services Regions where Amazon EFS is available.
tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: falseUse to create one or more tags associated with the file system. Each tag is a user-defined key-value pair. Name your file system on creation by including a
“Key”:“Name”,“Value”:“{value}”key-value pair. Each key must be unique. For more information, see Tagging Amazon Web Services resources in the Amazon Web Services General Reference Guide.
- On success, responds with
CreateFileSystemOutputwith field(s):owner_id(String):The Amazon Web Services account that created the file system.
creation_token(String):The opaque string specified in the request.
file_system_id(String):The ID of the file system, assigned by Amazon EFS.
file_system_arn(Option<String>):The Amazon Resource Name (ARN) for the EFS file system, in the format
arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id. Example with sample data:arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-system/fs-01234567creation_time(DateTime):The time that the file system was created, in seconds (since 1970-01-01T00:00:00Z).
life_cycle_state(LifeCycleState):The lifecycle phase of the file system.
name(Option<String>):You can add tags to a file system, including a
Nametag. For more information, seeCreateFileSystem. If the file system has aNametag, Amazon EFS returns the value in this field.number_of_mount_targets(i32):The current number of mount targets that the file system has. For more information, see
CreateMountTarget.size_in_bytes(Option<FileSystemSize>):The latest known metered size (in bytes) of data stored in the file system, in its
Valuefield, and the time at which that size was determined in itsTimestampfield. TheTimestampvalue is the integer number of seconds since 1970-01-01T00:00:00Z. TheSizeInBytesvalue doesn’t represent the size of a consistent snapshot of the file system, but it is eventually consistent when there are no writes to the file system. That is,SizeInBytesrepresents actual size only if the file system is not modified for a period longer than a couple of hours. Otherwise, the value is not the exact size that the file system was at any point in time.performance_mode(PerformanceMode):The performance mode of the file system.
encrypted(Option<bool>):A Boolean value that, if true, indicates that the file system is encrypted.
kms_key_id(Option<String>):The ID of an KMS key used to protect the encrypted file system.
throughput_mode(Option<ThroughputMode>):Displays the file system’s throughput mode. For more information, see Throughput modes in the Amazon EFS User Guide.
provisioned_throughput_in_mibps(Option<f64>):The amount of provisioned throughput, measured in MiBps, for the file system. Valid for file systems using
ThroughputModeset toprovisioned.availability_zone_name(Option<String>):Describes the Amazon Web Services Availability Zone in which the file system is located, and is valid only for One Zone file systems. For more information, see Using EFS storage classes in the Amazon EFS User Guide.
availability_zone_id(Option<String>):The unique and consistent identifier of the Availability Zone in which the file system is located, and is valid only for One Zone file systems. For example,
use1-az1is an Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has the same location in every Amazon Web Services account.tags(Vec::<Tag>):The tags associated with the file system, presented as an array of
Tagobjects.file_system_protection(Option<FileSystemProtectionDescription>):Describes the protection on the file system.
- On failure, responds with
SdkError<CreateFileSystemError>
Source§impl Client
impl Client
Sourcepub fn create_mount_target(&self) -> CreateMountTargetFluentBuilder
pub fn create_mount_target(&self) -> CreateMountTargetFluentBuilder
Constructs a fluent builder for the CreateMountTarget operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system for which to create the mount target.
subnet_id(impl Into<String>)/set_subnet_id(Option<String>):
required: trueThe ID of the subnet to add the mount target in. For One Zone file systems, use the subnet that is associated with the file system’s Availability Zone.
ip_address(impl Into<String>)/set_ip_address(Option<String>):
required: falseIf the IP address type for the mount target is IPv4, then specify the IPv4 address within the address range of the specified subnet.
ipv6_address(impl Into<String>)/set_ipv6_address(Option<String>):
required: falseIf the IP address type for the mount target is IPv6, then specify the IPv6 address within the address range of the specified subnet.
ip_address_type(IpAddressType)/set_ip_address_type(Option<IpAddressType>):
required: falseSpecify the type of IP address of the mount target you are creating. Options are IPv4, dual stack, or IPv6. If you don’t specify an IpAddressType, then IPv4 is used.
-
IPV4_ONLY – Create mount target with IPv4 only subnet or dual-stack subnet.
-
DUAL_STACK – Create mount target with dual-stack subnet.
-
IPV6_ONLY – Create mount target with IPv6 only subnet.
Creating IPv6 mount target only ENI in dual-stack subnet is not supported.
-
security_groups(impl Into<String>)/set_security_groups(Option<Vec::<String>>):
required: falseVPC security group IDs, of the form
sg-xxxxxxxx. These must be for the same VPC as the subnet specified. The maximum number of security groups depends on account quota. For more information, see Amazon VPC Quotas in the Amazon VPC User Guide (see the Security Groups table).
- On success, responds with
CreateMountTargetOutputwith field(s):owner_id(Option<String>):Amazon Web Services account ID that owns the resource.
mount_target_id(String):System-assigned mount target ID.
file_system_id(String):The ID of the file system for which the mount target is intended.
subnet_id(String):The ID of the mount target’s subnet.
life_cycle_state(LifeCycleState):Lifecycle state of the mount target.
ip_address(Option<String>):Address at which the file system can be mounted by using the mount target.
ipv6_address(Option<String>):The IPv6 address for the mount target.
network_interface_id(Option<String>):The ID of the network interface that Amazon EFS created when it created the mount target.
availability_zone_id(Option<String>):The unique and consistent identifier of the Availability Zone that the mount target resides in. For example,
use1-az1is an AZ ID for the us-east-1 Region and it has the same location in every Amazon Web Services account.availability_zone_name(Option<String>):The name of the Availability Zone in which the mount target is located. Availability Zones are independently mapped to names for each Amazon Web Services account. For example, the Availability Zone
us-east-1afor your Amazon Web Services account might not be the same location asus-east-1afor another Amazon Web Services account.vpc_id(Option<String>):The virtual private cloud (VPC) ID that the mount target is configured in.
- On failure, responds with
SdkError<CreateMountTargetError>
Source§impl Client
impl Client
Sourcepub fn create_replication_configuration(
&self,
) -> CreateReplicationConfigurationFluentBuilder
pub fn create_replication_configuration( &self, ) -> CreateReplicationConfigurationFluentBuilder
Constructs a fluent builder for the CreateReplicationConfiguration operation.
- The fluent builder is configurable:
source_file_system_id(impl Into<String>)/set_source_file_system_id(Option<String>):
required: trueSpecifies the Amazon EFS file system that you want to replicate. This file system cannot already be a source or destination file system in another replication configuration.
destinations(DestinationToCreate)/set_destinations(Option<Vec::<DestinationToCreate>>):
required: trueAn array of destination configuration objects. Only one destination configuration object is supported.
- On success, responds with
CreateReplicationConfigurationOutputwith field(s):source_file_system_id(String):The ID of the source Amazon EFS file system that is being replicated.
source_file_system_region(String):The Amazon Web Services Region in which the source EFS file system is located.
source_file_system_arn(String):The Amazon Resource Name (ARN) of the current source file system in the replication configuration.
original_source_file_system_arn(String):The Amazon Resource Name (ARN) of the original source EFS file system in the replication configuration.
creation_time(DateTime):Describes when the replication configuration was created.
destinations(Vec::<Destination>):An array of destination objects. Only one destination object is supported.
source_file_system_owner_id(Option<String>):ID of the Amazon Web Services account in which the source file system resides.
- On failure, responds with
SdkError<CreateReplicationConfigurationError>
Source§impl Client
impl Client
👎Deprecated: Use TagResource.
Constructs a fluent builder for the CreateTags operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system whose tags you want to modify (String). This operation modifies the tags only, not the file system.
tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: trueAn array of
Tagobjects to add. EachTagobject is a key-value pair.
- On success, responds with
CreateTagsOutput - On failure, responds with
SdkError<CreateTagsError>
Source§impl Client
impl Client
Sourcepub fn delete_access_point(&self) -> DeleteAccessPointFluentBuilder
pub fn delete_access_point(&self) -> DeleteAccessPointFluentBuilder
Constructs a fluent builder for the DeleteAccessPoint operation.
- The fluent builder is configurable:
access_point_id(impl Into<String>)/set_access_point_id(Option<String>):
required: trueThe ID of the access point that you want to delete.
- On success, responds with
DeleteAccessPointOutput - On failure, responds with
SdkError<DeleteAccessPointError>
Source§impl Client
impl Client
Sourcepub fn delete_file_system(&self) -> DeleteFileSystemFluentBuilder
pub fn delete_file_system(&self) -> DeleteFileSystemFluentBuilder
Constructs a fluent builder for the DeleteFileSystem operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system you want to delete.
- On success, responds with
DeleteFileSystemOutput - On failure, responds with
SdkError<DeleteFileSystemError>
Source§impl Client
impl Client
Sourcepub fn delete_file_system_policy(&self) -> DeleteFileSystemPolicyFluentBuilder
pub fn delete_file_system_policy(&self) -> DeleteFileSystemPolicyFluentBuilder
Constructs a fluent builder for the DeleteFileSystemPolicy operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueSpecifies the EFS file system for which to delete the
FileSystemPolicy.
- On success, responds with
DeleteFileSystemPolicyOutput - On failure, responds with
SdkError<DeleteFileSystemPolicyError>
Source§impl Client
impl Client
Sourcepub fn delete_mount_target(&self) -> DeleteMountTargetFluentBuilder
pub fn delete_mount_target(&self) -> DeleteMountTargetFluentBuilder
Constructs a fluent builder for the DeleteMountTarget operation.
- The fluent builder is configurable:
mount_target_id(impl Into<String>)/set_mount_target_id(Option<String>):
required: trueThe ID of the mount target to delete (String).
- On success, responds with
DeleteMountTargetOutput - On failure, responds with
SdkError<DeleteMountTargetError>
Source§impl Client
impl Client
Sourcepub fn delete_replication_configuration(
&self,
) -> DeleteReplicationConfigurationFluentBuilder
pub fn delete_replication_configuration( &self, ) -> DeleteReplicationConfigurationFluentBuilder
Constructs a fluent builder for the DeleteReplicationConfiguration operation.
- The fluent builder is configurable:
source_file_system_id(impl Into<String>)/set_source_file_system_id(Option<String>):
required: trueThe ID of the source file system in the replication configuration.
deletion_mode(DeletionMode)/set_deletion_mode(Option<DeletionMode>):
required: falseWhen replicating across Amazon Web Services accounts or across Amazon Web Services Regions, Amazon EFS deletes the replication configuration from both the source and destination account or Region (
ALL_CONFIGURATIONS) by default. If there’s a configuration or permissions issue that prevents Amazon EFS from deleting the replication configuration from both sides, you can use theLOCAL_CONFIGURATION_ONLYmode to delete the replication configuration from only the local side (the account or Region from which the delete is performed).Only use the
LOCAL_CONFIGURATION_ONLYmode in the case that Amazon EFS is unable to delete the replication configuration in both the source and destination account or Region. Deleting the local configuration leaves the configuration in the other account or Region unrecoverable.Additionally, do not use this mode for same-account, same-region replication as doing so results in a BadRequest exception error.
- On success, responds with
DeleteReplicationConfigurationOutput - On failure, responds with
SdkError<DeleteReplicationConfigurationError>
Source§impl Client
impl Client
👎Deprecated: Use UntagResource.
Constructs a fluent builder for the DeleteTags operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system whose tags you want to delete (String).
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec::<String>>):
required: trueA list of tag keys to delete.
- On success, responds with
DeleteTagsOutput - On failure, responds with
SdkError<DeleteTagsError>
Source§impl Client
impl Client
Sourcepub fn describe_access_points(&self) -> DescribeAccessPointsFluentBuilder
pub fn describe_access_points(&self) -> DescribeAccessPointsFluentBuilder
Constructs a fluent builder for the DescribeAccessPoints operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_results(i32)/set_max_results(Option<i32>):
required: false(Optional) When retrieving all access points for a file system, you can optionally specify the
MaxItemsparameter to limit the number of objects returned in a response. The default value is 100.next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseNextTokenis present if the response is paginated. You can useNextMarkerin the subsequent request to fetch the next page of access point descriptions.access_point_id(impl Into<String>)/set_access_point_id(Option<String>):
required: false(Optional) Specifies an EFS access point to describe in the response; mutually exclusive with
FileSystemId.file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: false(Optional) If you provide a
FileSystemId, EFS returns all access points for that file system; mutually exclusive withAccessPointId.
- On success, responds with
DescribeAccessPointsOutputwith field(s):access_points(Option<Vec::<AccessPointDescription>>):An array of access point descriptions.
next_token(Option<String>):Present if there are more access points than returned in the response. You can use the NextMarker in the subsequent request to fetch the additional descriptions.
- On failure, responds with
SdkError<DescribeAccessPointsError>
Source§impl Client
impl Client
Sourcepub fn describe_account_preferences(
&self,
) -> DescribeAccountPreferencesFluentBuilder
pub fn describe_account_preferences( &self, ) -> DescribeAccountPreferencesFluentBuilder
Constructs a fluent builder for the DescribeAccountPreferences operation.
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):
required: false(Optional) You can use
NextTokenin a subsequent request to fetch the next page of Amazon Web Services account preferences if the response payload was paginated.max_results(i32)/set_max_results(Option<i32>):
required: false(Optional) When retrieving account preferences, you can optionally specify the
MaxItemsparameter to limit the number of objects returned in a response. The default value is 100.
- On success, responds with
DescribeAccountPreferencesOutputwith field(s):resource_id_preference(Option<ResourceIdPreference>):Describes the resource ID preference setting for the Amazon Web Services account associated with the user making the request, in the current Amazon Web Services Region.
next_token(Option<String>):Present if there are more records than returned in the response. You can use the
NextTokenin the subsequent request to fetch the additional descriptions.
- On failure, responds with
SdkError<DescribeAccountPreferencesError>
Source§impl Client
impl Client
Sourcepub fn describe_backup_policy(&self) -> DescribeBackupPolicyFluentBuilder
pub fn describe_backup_policy(&self) -> DescribeBackupPolicyFluentBuilder
Constructs a fluent builder for the DescribeBackupPolicy operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueSpecifies which EFS file system for which to retrieve the
BackupPolicy.
- On success, responds with
DescribeBackupPolicyOutputwith field(s):backup_policy(Option<BackupPolicy>):Describes the file system’s backup policy, indicating whether automatic backups are turned on or off.
- On failure, responds with
SdkError<DescribeBackupPolicyError>
Source§impl Client
impl Client
Sourcepub fn describe_file_system_policy(
&self,
) -> DescribeFileSystemPolicyFluentBuilder
pub fn describe_file_system_policy( &self, ) -> DescribeFileSystemPolicyFluentBuilder
Constructs a fluent builder for the DescribeFileSystemPolicy operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueSpecifies which EFS file system to retrieve the
FileSystemPolicyfor.
- On success, responds with
DescribeFileSystemPolicyOutputwith field(s):file_system_id(Option<String>):Specifies the EFS file system to which the
FileSystemPolicyapplies.policy(Option<String>):The JSON formatted
FileSystemPolicyfor the EFS file system.
- On failure, responds with
SdkError<DescribeFileSystemPolicyError>
Source§impl Client
impl Client
Sourcepub fn describe_file_systems(&self) -> DescribeFileSystemsFluentBuilder
pub fn describe_file_systems(&self) -> DescribeFileSystemsFluentBuilder
Constructs a fluent builder for the DescribeFileSystems operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_items(i32)/set_max_items(Option<i32>):
required: false(Optional) Specifies the maximum number of file systems to return in the response (integer). This number is automatically set to 100. The response is paginated at 100 per page if you have more than 100 file systems.
marker(impl Into<String>)/set_marker(Option<String>):
required: false(Optional) Opaque pagination token returned from a previous
DescribeFileSystemsoperation (String). If present, specifies to continue the list from where the returning call had left off.creation_token(impl Into<String>)/set_creation_token(Option<String>):
required: false(Optional) Restricts the list to the file system with this creation token (String). You specify a creation token when you create an Amazon EFS file system.
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: false(Optional) ID of the file system whose description you want to retrieve (String).
- On success, responds with
DescribeFileSystemsOutputwith field(s):marker(Option<String>):Present if provided by caller in the request (String).
file_systems(Option<Vec::<FileSystemDescription>>):An array of file system descriptions.
next_marker(Option<String>):Present if there are more file systems than returned in the response (String). You can use the
NextMarkerin the subsequent request to fetch the descriptions.
- On failure, responds with
SdkError<DescribeFileSystemsError>
Source§impl Client
impl Client
Sourcepub fn describe_lifecycle_configuration(
&self,
) -> DescribeLifecycleConfigurationFluentBuilder
pub fn describe_lifecycle_configuration( &self, ) -> DescribeLifecycleConfigurationFluentBuilder
Constructs a fluent builder for the DescribeLifecycleConfiguration operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system whose
LifecycleConfigurationobject you want to retrieve (String).
- On success, responds with
DescribeLifecycleConfigurationOutputwith field(s):lifecycle_policies(Option<Vec::<LifecyclePolicy>>):An array of lifecycle management policies. EFS supports a maximum of one policy per file system.
- On failure, responds with
SdkError<DescribeLifecycleConfigurationError>
Source§impl Client
impl Client
Sourcepub fn describe_mount_target_security_groups(
&self,
) -> DescribeMountTargetSecurityGroupsFluentBuilder
pub fn describe_mount_target_security_groups( &self, ) -> DescribeMountTargetSecurityGroupsFluentBuilder
Constructs a fluent builder for the DescribeMountTargetSecurityGroups operation.
- The fluent builder is configurable:
mount_target_id(impl Into<String>)/set_mount_target_id(Option<String>):
required: trueThe ID of the mount target whose security groups you want to retrieve.
- On success, responds with
DescribeMountTargetSecurityGroupsOutputwith field(s):security_groups(Vec::<String>):An array of security groups.
- On failure, responds with
SdkError<DescribeMountTargetSecurityGroupsError>
Source§impl Client
impl Client
Sourcepub fn describe_mount_targets(&self) -> DescribeMountTargetsFluentBuilder
pub fn describe_mount_targets(&self) -> DescribeMountTargetsFluentBuilder
Constructs a fluent builder for the DescribeMountTargets operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_items(i32)/set_max_items(Option<i32>):
required: false(Optional) Maximum number of mount targets to return in the response. Currently, this number is automatically set to 10, and other values are ignored. The response is paginated at 100 per page if you have more than 100 mount targets.
marker(impl Into<String>)/set_marker(Option<String>):
required: false(Optional) Opaque pagination token returned from a previous
DescribeMountTargetsoperation (String). If present, it specifies to continue the list from where the previous returning call left off.file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: false(Optional) ID of the file system whose mount targets you want to list (String). It must be included in your request if an
AccessPointIdorMountTargetIdis not included. Accepts either a file system ID or ARN as input.mount_target_id(impl Into<String>)/set_mount_target_id(Option<String>):
required: false(Optional) ID of the mount target that you want to have described (String). It must be included in your request if
FileSystemIdis not included. Accepts either a mount target ID or ARN as input.access_point_id(impl Into<String>)/set_access_point_id(Option<String>):
required: false(Optional) The ID of the access point whose mount targets that you want to list. It must be included in your request if a
FileSystemIdorMountTargetIdis not included in your request. Accepts either an access point ID or ARN as input.
- On success, responds with
DescribeMountTargetsOutputwith field(s):marker(Option<String>):If the request included the
Marker, the response returns that value in this field.mount_targets(Option<Vec::<MountTargetDescription>>):Returns the file system’s mount targets as an array of
MountTargetDescriptionobjects.next_marker(Option<String>):If a value is present, there are more mount targets to return. In a subsequent request, you can provide
Markerin your request with this value to retrieve the next set of mount targets.
- On failure, responds with
SdkError<DescribeMountTargetsError>
Source§impl Client
impl Client
Sourcepub fn describe_replication_configurations(
&self,
) -> DescribeReplicationConfigurationsFluentBuilder
pub fn describe_replication_configurations( &self, ) -> DescribeReplicationConfigurationsFluentBuilder
Constructs a fluent builder for the DescribeReplicationConfigurations operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: falseYou can retrieve the replication configuration for a specific file system by providing its file system ID. For cross-account,cross-region replication, an account can only describe the replication configuration for a file system in its own Region.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseNextTokenis present if the response is paginated. You can useNextTokenin a subsequent request to fetch the next page of output.max_results(i32)/set_max_results(Option<i32>):
required: false(Optional) To limit the number of objects returned in a response, you can specify the
MaxItemsparameter. The default value is 100.
- On success, responds with
DescribeReplicationConfigurationsOutputwith field(s):replications(Option<Vec::<ReplicationConfigurationDescription>>):The collection of replication configurations that is returned.
next_token(Option<String>):You can use the
NextTokenfrom the previous response in a subsequent request to fetch the additional descriptions.
- On failure, responds with
SdkError<DescribeReplicationConfigurationsError>
Source§impl Client
impl Client
👎Deprecated: Use ListTagsForResource.
Constructs a fluent builder for the DescribeTags operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_items(i32)/set_max_items(Option<i32>):
required: false(Optional) The maximum number of file system tags to return in the response. Currently, this number is automatically set to 100, and other values are ignored. The response is paginated at 100 per page if you have more than 100 tags.
marker(impl Into<String>)/set_marker(Option<String>):
required: false(Optional) An opaque pagination token returned from a previous
DescribeTagsoperation (String). If present, it specifies to continue the list from where the previous call left off.file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system whose tag set you want to retrieve.
- On success, responds with
DescribeTagsOutputwith field(s):marker(Option<String>):If the request included a
Marker, the response returns that value in this field.tags(Vec::<Tag>):Returns tags associated with the file system as an array of
Tagobjects.next_marker(Option<String>):If a value is present, there are more tags to return. In a subsequent request, you can provide the value of
NextMarkeras the value of theMarkerparameter in your next request to retrieve the next set of tags.
- On failure, responds with
SdkError<DescribeTagsError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
resource_id(impl Into<String>)/set_resource_id(Option<String>):
required: trueSpecifies the EFS resource you want to retrieve tags for. You can retrieve tags for EFS file systems and access points using this API endpoint.
max_results(i32)/set_max_results(Option<i32>):
required: false(Optional) Specifies the maximum number of tag objects to return in the response. The default value is 100.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: false(Optional) You can use
NextTokenin a subsequent request to fetch the next page of access point descriptions if the response payload was paginated.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<Vec::<Tag>>):An array of the tags for the specified EFS resource.
next_token(Option<String>):NextTokenis present if the response payload is paginated. You can useNextTokenin a subsequent request to fetch the next page of access point descriptions.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn modify_mount_target_security_groups(
&self,
) -> ModifyMountTargetSecurityGroupsFluentBuilder
pub fn modify_mount_target_security_groups( &self, ) -> ModifyMountTargetSecurityGroupsFluentBuilder
Constructs a fluent builder for the ModifyMountTargetSecurityGroups operation.
- The fluent builder is configurable:
mount_target_id(impl Into<String>)/set_mount_target_id(Option<String>):
required: trueThe ID of the mount target whose security groups you want to modify.
security_groups(impl Into<String>)/set_security_groups(Option<Vec::<String>>):
required: falseAn array of VPC security group IDs.
- On success, responds with
ModifyMountTargetSecurityGroupsOutput - On failure, responds with
SdkError<ModifyMountTargetSecurityGroupsError>
Source§impl Client
impl Client
Sourcepub fn put_account_preferences(&self) -> PutAccountPreferencesFluentBuilder
pub fn put_account_preferences(&self) -> PutAccountPreferencesFluentBuilder
Constructs a fluent builder for the PutAccountPreferences operation.
- The fluent builder is configurable:
resource_id_type(ResourceIdType)/set_resource_id_type(Option<ResourceIdType>):
required: trueSpecifies the EFS resource ID preference to set for the user’s Amazon Web Services account, in the current Amazon Web Services Region, either
LONG_ID(17 characters), orSHORT_ID(8 characters).Starting in October, 2021, you will receive an error when setting the account preference to
SHORT_ID. Contact Amazon Web Services support if you receive an error and must use short IDs for file system and mount target resources.
- On success, responds with
PutAccountPreferencesOutputwith field(s):resource_id_preference(Option<ResourceIdPreference>):Describes the resource type and its ID preference for the user’s Amazon Web Services account, in the current Amazon Web Services Region.
- On failure, responds with
SdkError<PutAccountPreferencesError>
Source§impl Client
impl Client
Sourcepub fn put_backup_policy(&self) -> PutBackupPolicyFluentBuilder
pub fn put_backup_policy(&self) -> PutBackupPolicyFluentBuilder
Constructs a fluent builder for the PutBackupPolicy operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueSpecifies which EFS file system to update the backup policy for.
backup_policy(BackupPolicy)/set_backup_policy(Option<BackupPolicy>):
required: trueThe backup policy included in the
PutBackupPolicyrequest.
- On success, responds with
PutBackupPolicyOutputwith field(s):backup_policy(Option<BackupPolicy>):Describes the file system’s backup policy, indicating whether automatic backups are turned on or off.
- On failure, responds with
SdkError<PutBackupPolicyError>
Source§impl Client
impl Client
Sourcepub fn put_file_system_policy(&self) -> PutFileSystemPolicyFluentBuilder
pub fn put_file_system_policy(&self) -> PutFileSystemPolicyFluentBuilder
Constructs a fluent builder for the PutFileSystemPolicy operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the EFS file system that you want to create or update the
FileSystemPolicyfor.policy(impl Into<String>)/set_policy(Option<String>):
required: trueThe
FileSystemPolicythat you’re creating. Accepts a JSON formatted policy definition. EFS file system policies have a 20,000 character limit. To find out more about the elements that make up a file system policy, see Resource-based policies within Amazon EFS.bypass_policy_lockout_safety_check(bool)/set_bypass_policy_lockout_safety_check(Option<bool>):
required: false(Optional) A boolean that specifies whether or not to bypass the
FileSystemPolicylockout safety check. The lockout safety check determines whether the policy in the request will lock out, or prevent, the IAM principal that is making the request from making futurePutFileSystemPolicyrequests on this file system. SetBypassPolicyLockoutSafetyChecktoTrueonly when you intend to prevent the IAM principal that is making the request from making subsequentPutFileSystemPolicyrequests on this file system. The default value isFalse.
- On success, responds with
PutFileSystemPolicyOutputwith field(s):file_system_id(Option<String>):Specifies the EFS file system to which the
FileSystemPolicyapplies.policy(Option<String>):The JSON formatted
FileSystemPolicyfor the EFS file system.
- On failure, responds with
SdkError<PutFileSystemPolicyError>
Source§impl Client
impl Client
Sourcepub fn put_lifecycle_configuration(
&self,
) -> PutLifecycleConfigurationFluentBuilder
pub fn put_lifecycle_configuration( &self, ) -> PutLifecycleConfigurationFluentBuilder
Constructs a fluent builder for the PutLifecycleConfiguration operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system for which you are creating the
LifecycleConfigurationobject (String).lifecycle_policies(LifecyclePolicy)/set_lifecycle_policies(Option<Vec::<LifecyclePolicy>>):
required: trueAn array of
LifecyclePolicyobjects that define the file system’sLifecycleConfigurationobject. ALifecycleConfigurationobject informs lifecycle management of the following:-
TransitionToIA– When to move files in the file system from primary storage (Standard storage class) into the Infrequent Access (IA) storage. -
TransitionToArchive– When to move files in the file system from their current storage class (either IA or Standard storage) into the Archive storage.File systems cannot transition into Archive storage before transitioning into IA storage. Therefore, TransitionToArchive must either not be set or must be later than TransitionToIA.
The Archive storage class is available only for file systems that use the Elastic throughput mode and the General Purpose performance mode.
-
TransitionToPrimaryStorageClass– Whether to move files in the file system back to primary storage (Standard storage class) after they are accessed in IA or Archive storage.
When using the
put-lifecycle-configurationCLI command or thePutLifecycleConfigurationAPI action, Amazon EFS requires that eachLifecyclePolicyobject have only a single transition. This means that in a request body,LifecyclePoliciesmust be structured as an array ofLifecyclePolicyobjects, one object for each storage transition. See the example requests in the following section for more information.-
- On success, responds with
PutLifecycleConfigurationOutputwith field(s):lifecycle_policies(Option<Vec::<LifecyclePolicy>>):An array of lifecycle management policies. EFS supports a maximum of one policy per file system.
- On failure, responds with
SdkError<PutLifecycleConfigurationError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource operation.
- The fluent builder is configurable:
resource_id(impl Into<String>)/set_resource_id(Option<String>):
required: trueThe ID specifying the EFS resource that you want to create a tag for.
tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: trueAn array of
Tagobjects to add. EachTagobject is a key-value pair.
- On success, responds with
TagResourceOutput - On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource operation.
- The fluent builder is configurable:
resource_id(impl Into<String>)/set_resource_id(Option<String>):
required: trueSpecifies the EFS resource that you want to remove tags from.
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec::<String>>):
required: trueThe keys of the key-value tag pairs that you want to remove from the specified EFS resource.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_file_system(&self) -> UpdateFileSystemFluentBuilder
pub fn update_file_system(&self) -> UpdateFileSystemFluentBuilder
Constructs a fluent builder for the UpdateFileSystem operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system that you want to update.
throughput_mode(ThroughputMode)/set_throughput_mode(Option<ThroughputMode>):
required: false(Optional) Updates the file system’s throughput mode. If you’re not updating your throughput mode, you don’t need to provide this value in your request. If you are changing the
ThroughputModetoprovisioned, you must also set a value forProvisionedThroughputInMibps.provisioned_throughput_in_mibps(f64)/set_provisioned_throughput_in_mibps(Option<f64>):
required: false(Optional) The throughput, measured in mebibytes per second (MiBps), that you want to provision for a file system that you’re creating. Required if
ThroughputModeis set toprovisioned. Valid values are 1-3414 MiBps, with the upper limit depending on Region. To increase this limit, contact Amazon Web ServicesSupport. For more information, see Amazon EFS quotas that you can increase in the Amazon EFS User Guide.
- On success, responds with
UpdateFileSystemOutputwith field(s):owner_id(String):The Amazon Web Services account that created the file system.
creation_token(String):The opaque string specified in the request.
file_system_id(String):The ID of the file system, assigned by Amazon EFS.
file_system_arn(Option<String>):The Amazon Resource Name (ARN) for the EFS file system, in the format
arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id. Example with sample data:arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-system/fs-01234567creation_time(DateTime):The time that the file system was created, in seconds (since 1970-01-01T00:00:00Z).
life_cycle_state(LifeCycleState):The lifecycle phase of the file system.
name(Option<String>):You can add tags to a file system, including a
Nametag. For more information, seeCreateFileSystem. If the file system has aNametag, Amazon EFS returns the value in this field.number_of_mount_targets(i32):The current number of mount targets that the file system has. For more information, see
CreateMountTarget.size_in_bytes(Option<FileSystemSize>):The latest known metered size (in bytes) of data stored in the file system, in its
Valuefield, and the time at which that size was determined in itsTimestampfield. TheTimestampvalue is the integer number of seconds since 1970-01-01T00:00:00Z. TheSizeInBytesvalue doesn’t represent the size of a consistent snapshot of the file system, but it is eventually consistent when there are no writes to the file system. That is,SizeInBytesrepresents actual size only if the file system is not modified for a period longer than a couple of hours. Otherwise, the value is not the exact size that the file system was at any point in time.performance_mode(PerformanceMode):The performance mode of the file system.
encrypted(Option<bool>):A Boolean value that, if true, indicates that the file system is encrypted.
kms_key_id(Option<String>):The ID of an KMS key used to protect the encrypted file system.
throughput_mode(Option<ThroughputMode>):Displays the file system’s throughput mode. For more information, see Throughput modes in the Amazon EFS User Guide.
provisioned_throughput_in_mibps(Option<f64>):The amount of provisioned throughput, measured in MiBps, for the file system. Valid for file systems using
ThroughputModeset toprovisioned.availability_zone_name(Option<String>):Describes the Amazon Web Services Availability Zone in which the file system is located, and is valid only for One Zone file systems. For more information, see Using EFS storage classes in the Amazon EFS User Guide.
availability_zone_id(Option<String>):The unique and consistent identifier of the Availability Zone in which the file system is located, and is valid only for One Zone file systems. For example,
use1-az1is an Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has the same location in every Amazon Web Services account.tags(Vec::<Tag>):The tags associated with the file system, presented as an array of
Tagobjects.file_system_protection(Option<FileSystemProtectionDescription>):Describes the protection on the file system.
- On failure, responds with
SdkError<UpdateFileSystemError>
Source§impl Client
impl Client
Sourcepub fn update_file_system_protection(
&self,
) -> UpdateFileSystemProtectionFluentBuilder
pub fn update_file_system_protection( &self, ) -> UpdateFileSystemProtectionFluentBuilder
Constructs a fluent builder for the UpdateFileSystemProtection operation.
- The fluent builder is configurable:
file_system_id(impl Into<String>)/set_file_system_id(Option<String>):
required: trueThe ID of the file system to update.
replication_overwrite_protection(ReplicationOverwriteProtection)/set_replication_overwrite_protection(Option<ReplicationOverwriteProtection>):
required: falseThe status of the file system’s replication overwrite protection.
-
ENABLED– The file system cannot be used as the destination file system in a replication configuration. The file system is writeable. Replication overwrite protection isENABLEDby default. -
DISABLED– The file system can be used as the destination file system in a replication configuration. The file system is read-only and can only be modified by EFS replication. -
REPLICATING– The file system is being used as the destination file system in a replication configuration. The file system is read-only and is only modified only by EFS replication.
If the replication configuration is deleted, the file system’s replication overwrite protection is re-enabled and the file system becomes writeable.
-
- On success, responds with
UpdateFileSystemProtectionOutputwith field(s):replication_overwrite_protection(Option<ReplicationOverwriteProtection>):The status of the file system’s replication overwrite protection.
-
ENABLED– The file system cannot be used as the destination file system in a replication configuration. The file system is writeable. Replication overwrite protection isENABLEDby default. -
DISABLED– The file system can be used as the destination file system in a replication configuration. The file system is read-only and can only be modified by EFS replication. -
REPLICATING– The file system is being used as the destination file system in a replication configuration. The file system is read-only and is modified only by EFS replication.
If the replication configuration is deleted, the file system’s replication overwrite protection is re-enabled, the file system becomes writeable.
-
- On failure, responds with
SdkError<UpdateFileSystemProtectionError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_implconfigured. - Identity caching is enabled without a
sleep_implandtime_sourceconfigured. - No
behavior_versionis provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it. - This method will panic if no
BehaviorVersionis provided. If you experience this panic, setbehavior_versionon the Config or enable thebehavior-version-latestCargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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);