pub struct CreateClusterFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateCluster
.
Creates an Amazon EKS control plane.
The Amazon EKS control plane consists of control plane instances that run the Kubernetes software, such as etcd
and the API server. The control plane runs in an account managed by Amazon Web Services, and the Kubernetes API is exposed by the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is single tenant and unique. It runs on its own set of Amazon EC2 instances.
The cluster control plane is provisioned across multiple Availability Zones and fronted by an Elastic Load Balancing Network Load Balancer. Amazon EKS also provisions elastic network interfaces in your VPC subnets to provide connectivity from the control plane instances to the nodes (for example, to support kubectl exec
, logs
, and proxy
data flows).
Amazon EKS nodes run in your Amazon Web Services account and connect to your cluster's control plane over the Kubernetes API server endpoint and a certificate file that is created for your cluster.
You can use the endpointPublicAccess
and endpointPrivateAccess
parameters to enable or disable public and private access to your cluster's Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. The endpoint domain name and IP address family depends on the value of the ipFamily
for the cluster. For more information, see Amazon EKS Cluster Endpoint Access Control in the Amazon EKS User Guide .
You can use the logging
parameter to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
In most cases, it takes several minutes to create a cluster. After you create an Amazon EKS cluster, you must configure your Kubernetes tooling to communicate with the API server and launch nodes into your cluster. For more information, see Allowing users to access your cluster and Launching Amazon EKS nodes in the Amazon EKS User Guide.
Implementations§
Source§impl CreateClusterFluentBuilder
impl CreateClusterFluentBuilder
Sourcepub fn as_input(&self) -> &CreateClusterInputBuilder
pub fn as_input(&self) -> &CreateClusterInputBuilder
Access the CreateCluster as a reference.
Sourcepub async fn send(
self,
) -> Result<CreateClusterOutput, SdkError<CreateClusterError, HttpResponse>>
pub async fn send( self, ) -> Result<CreateClusterOutput, SdkError<CreateClusterError, 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<CreateClusterOutput, CreateClusterError, Self>
pub fn customize( self, ) -> CustomizableOperation<CreateClusterOutput, CreateClusterError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
The unique name to give to your cluster. The name can contain only alphanumeric characters (case-sensitive), hyphens, and underscores. It must start with an alphanumeric character and can't be longer than 100 characters. The name must be unique within the Amazon Web Services Region and Amazon Web Services account that you're creating the cluster in.
Sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
The unique name to give to your cluster. The name can contain only alphanumeric characters (case-sensitive), hyphens, and underscores. It must start with an alphanumeric character and can't be longer than 100 characters. The name must be unique within the Amazon Web Services Region and Amazon Web Services account that you're creating the cluster in.
Sourcepub fn get_name(&self) -> &Option<String>
pub fn get_name(&self) -> &Option<String>
The unique name to give to your cluster. The name can contain only alphanumeric characters (case-sensitive), hyphens, and underscores. It must start with an alphanumeric character and can't be longer than 100 characters. The name must be unique within the Amazon Web Services Region and Amazon Web Services account that you're creating the cluster in.
Sourcepub fn version(self, input: impl Into<String>) -> Self
pub fn version(self, input: impl Into<String>) -> Self
The desired Kubernetes version for your cluster. If you don't specify a value here, the default version available in Amazon EKS is used.
The default version might not be the latest version available.
Sourcepub fn set_version(self, input: Option<String>) -> Self
pub fn set_version(self, input: Option<String>) -> Self
The desired Kubernetes version for your cluster. If you don't specify a value here, the default version available in Amazon EKS is used.
The default version might not be the latest version available.
Sourcepub fn get_version(&self) -> &Option<String>
pub fn get_version(&self) -> &Option<String>
The desired Kubernetes version for your cluster. If you don't specify a value here, the default version available in Amazon EKS is used.
The default version might not be the latest version available.
Sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
Sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
Sourcepub fn get_role_arn(&self) -> &Option<String>
pub fn get_role_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
Sourcepub fn resources_vpc_config(self, input: VpcConfigRequest) -> Self
pub fn resources_vpc_config(self, input: VpcConfigRequest) -> Self
The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can specify up to five security groups. However, we recommend that you use a dedicated security group for your cluster control plane.
Sourcepub fn set_resources_vpc_config(self, input: Option<VpcConfigRequest>) -> Self
pub fn set_resources_vpc_config(self, input: Option<VpcConfigRequest>) -> Self
The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can specify up to five security groups. However, we recommend that you use a dedicated security group for your cluster control plane.
Sourcepub fn get_resources_vpc_config(&self) -> &Option<VpcConfigRequest>
pub fn get_resources_vpc_config(&self) -> &Option<VpcConfigRequest>
The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can specify up to five security groups. However, we recommend that you use a dedicated security group for your cluster control plane.
Sourcepub fn kubernetes_network_config(
self,
input: KubernetesNetworkConfigRequest,
) -> Self
pub fn kubernetes_network_config( self, input: KubernetesNetworkConfigRequest, ) -> Self
The Kubernetes network configuration for the cluster.
Sourcepub fn set_kubernetes_network_config(
self,
input: Option<KubernetesNetworkConfigRequest>,
) -> Self
pub fn set_kubernetes_network_config( self, input: Option<KubernetesNetworkConfigRequest>, ) -> Self
The Kubernetes network configuration for the cluster.
Sourcepub fn get_kubernetes_network_config(
&self,
) -> &Option<KubernetesNetworkConfigRequest>
pub fn get_kubernetes_network_config( &self, ) -> &Option<KubernetesNetworkConfigRequest>
The Kubernetes network configuration for the cluster.
Sourcepub fn logging(self, input: Logging) -> Self
pub fn logging(self, input: Logging) -> Self
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs . By default, cluster control plane logs aren't exported to CloudWatch Logs . For more information, see Amazon EKS Cluster control plane logs in the Amazon EKS User Guide .
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
Sourcepub fn set_logging(self, input: Option<Logging>) -> Self
pub fn set_logging(self, input: Option<Logging>) -> Self
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs . By default, cluster control plane logs aren't exported to CloudWatch Logs . For more information, see Amazon EKS Cluster control plane logs in the Amazon EKS User Guide .
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
Sourcepub fn get_logging(&self) -> &Option<Logging>
pub fn get_logging(&self) -> &Option<Logging>
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs . By default, cluster control plane logs aren't exported to CloudWatch Logs . For more information, see Amazon EKS Cluster control plane logs in the Amazon EKS User Guide .
CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing.
Sourcepub fn client_request_token(self, input: impl Into<String>) -> Self
pub fn client_request_token(self, input: impl Into<String>) -> Self
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
Sourcepub fn set_client_request_token(self, input: Option<String>) -> Self
pub fn set_client_request_token(self, input: Option<String>) -> Self
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
Sourcepub fn get_client_request_token(&self) -> &Option<String>
pub fn get_client_request_token(&self) -> &Option<String>
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
Adds a key-value pair to tags
.
To override the contents of this collection use set_tags
.
Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
Sourcepub fn encryption_config(self, input: EncryptionConfig) -> Self
pub fn encryption_config(self, input: EncryptionConfig) -> Self
Appends an item to encryptionConfig
.
To override the contents of this collection use set_encryption_config
.
The encryption configuration for the cluster.
Sourcepub fn set_encryption_config(self, input: Option<Vec<EncryptionConfig>>) -> Self
pub fn set_encryption_config(self, input: Option<Vec<EncryptionConfig>>) -> Self
The encryption configuration for the cluster.
Sourcepub fn get_encryption_config(&self) -> &Option<Vec<EncryptionConfig>>
pub fn get_encryption_config(&self) -> &Option<Vec<EncryptionConfig>>
The encryption configuration for the cluster.
Sourcepub fn outpost_config(self, input: OutpostConfigRequest) -> Self
pub fn outpost_config(self, input: OutpostConfigRequest) -> Self
An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. Before creating a local cluster on an Outpost, review Local clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud.
Sourcepub fn set_outpost_config(self, input: Option<OutpostConfigRequest>) -> Self
pub fn set_outpost_config(self, input: Option<OutpostConfigRequest>) -> Self
An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. Before creating a local cluster on an Outpost, review Local clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud.
Sourcepub fn get_outpost_config(&self) -> &Option<OutpostConfigRequest>
pub fn get_outpost_config(&self) -> &Option<OutpostConfigRequest>
An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. Before creating a local cluster on an Outpost, review Local clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud.
Sourcepub fn access_config(self, input: CreateAccessConfigRequest) -> Self
pub fn access_config(self, input: CreateAccessConfigRequest) -> Self
The access configuration for the cluster.
Sourcepub fn set_access_config(self, input: Option<CreateAccessConfigRequest>) -> Self
pub fn set_access_config(self, input: Option<CreateAccessConfigRequest>) -> Self
The access configuration for the cluster.
Sourcepub fn get_access_config(&self) -> &Option<CreateAccessConfigRequest>
pub fn get_access_config(&self) -> &Option<CreateAccessConfigRequest>
The access configuration for the cluster.
Sourcepub fn bootstrap_self_managed_addons(self, input: bool) -> Self
pub fn bootstrap_self_managed_addons(self, input: bool) -> Self
If you set this value to False
when creating a cluster, the default networking add-ons will not be installed.
The default networking add-ons include vpc-cni
, coredns
, and kube-proxy
.
Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.
Sourcepub fn set_bootstrap_self_managed_addons(self, input: Option<bool>) -> Self
pub fn set_bootstrap_self_managed_addons(self, input: Option<bool>) -> Self
If you set this value to False
when creating a cluster, the default networking add-ons will not be installed.
The default networking add-ons include vpc-cni
, coredns
, and kube-proxy
.
Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.
Sourcepub fn get_bootstrap_self_managed_addons(&self) -> &Option<bool>
pub fn get_bootstrap_self_managed_addons(&self) -> &Option<bool>
If you set this value to False
when creating a cluster, the default networking add-ons will not be installed.
The default networking add-ons include vpc-cni
, coredns
, and kube-proxy
.
Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.
Sourcepub fn upgrade_policy(self, input: UpgradePolicyRequest) -> Self
pub fn upgrade_policy(self, input: UpgradePolicyRequest) -> Self
New clusters, by default, have extended support enabled. You can disable extended support when creating a cluster by setting this value to STANDARD
.
Sourcepub fn set_upgrade_policy(self, input: Option<UpgradePolicyRequest>) -> Self
pub fn set_upgrade_policy(self, input: Option<UpgradePolicyRequest>) -> Self
New clusters, by default, have extended support enabled. You can disable extended support when creating a cluster by setting this value to STANDARD
.
Sourcepub fn get_upgrade_policy(&self) -> &Option<UpgradePolicyRequest>
pub fn get_upgrade_policy(&self) -> &Option<UpgradePolicyRequest>
New clusters, by default, have extended support enabled. You can disable extended support when creating a cluster by setting this value to STANDARD
.
Sourcepub fn zonal_shift_config(self, input: ZonalShiftConfigRequest) -> Self
pub fn zonal_shift_config(self, input: ZonalShiftConfigRequest) -> Self
Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC zonal shift is designed to be a temporary measure that allows you to move traffic for a resource away from an impaired AZ until the zonal shift expires or you cancel it. You can extend the zonal shift if necessary.
You can start a zonal shift for an Amazon EKS cluster, or you can allow Amazon Web Services to do it for you by enabling zonal autoshift. This shift updates the flow of east-to-west network traffic in your cluster to only consider network endpoints for Pods running on worker nodes in healthy AZs. Additionally, any ALB or NLB handling ingress traffic for applications in your Amazon EKS cluster will automatically route traffic to targets in the healthy AZs. For more information about zonal shift in EKS, see Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS in the Amazon EKS User Guide .
Sourcepub fn set_zonal_shift_config(
self,
input: Option<ZonalShiftConfigRequest>,
) -> Self
pub fn set_zonal_shift_config( self, input: Option<ZonalShiftConfigRequest>, ) -> Self
Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC zonal shift is designed to be a temporary measure that allows you to move traffic for a resource away from an impaired AZ until the zonal shift expires or you cancel it. You can extend the zonal shift if necessary.
You can start a zonal shift for an Amazon EKS cluster, or you can allow Amazon Web Services to do it for you by enabling zonal autoshift. This shift updates the flow of east-to-west network traffic in your cluster to only consider network endpoints for Pods running on worker nodes in healthy AZs. Additionally, any ALB or NLB handling ingress traffic for applications in your Amazon EKS cluster will automatically route traffic to targets in the healthy AZs. For more information about zonal shift in EKS, see Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS in the Amazon EKS User Guide .
Sourcepub fn get_zonal_shift_config(&self) -> &Option<ZonalShiftConfigRequest>
pub fn get_zonal_shift_config(&self) -> &Option<ZonalShiftConfigRequest>
Enable or disable ARC zonal shift for the cluster. If zonal shift is enabled, Amazon Web Services configures zonal autoshift for the cluster.
Zonal shift is a feature of Amazon Application Recovery Controller (ARC). ARC zonal shift is designed to be a temporary measure that allows you to move traffic for a resource away from an impaired AZ until the zonal shift expires or you cancel it. You can extend the zonal shift if necessary.
You can start a zonal shift for an Amazon EKS cluster, or you can allow Amazon Web Services to do it for you by enabling zonal autoshift. This shift updates the flow of east-to-west network traffic in your cluster to only consider network endpoints for Pods running on worker nodes in healthy AZs. Additionally, any ALB or NLB handling ingress traffic for applications in your Amazon EKS cluster will automatically route traffic to targets in the healthy AZs. For more information about zonal shift in EKS, see Learn about Amazon Application Recovery Controller (ARC) Zonal Shift in Amazon EKS in the Amazon EKS User Guide .
Sourcepub fn remote_network_config(self, input: RemoteNetworkConfigRequest) -> Self
pub fn remote_network_config(self, input: RemoteNetworkConfigRequest) -> Self
The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or remove this configuration after the cluster is created.
Sourcepub fn set_remote_network_config(
self,
input: Option<RemoteNetworkConfigRequest>,
) -> Self
pub fn set_remote_network_config( self, input: Option<RemoteNetworkConfigRequest>, ) -> Self
The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or remove this configuration after the cluster is created.
Sourcepub fn get_remote_network_config(&self) -> &Option<RemoteNetworkConfigRequest>
pub fn get_remote_network_config(&self) -> &Option<RemoteNetworkConfigRequest>
The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or remove this configuration after the cluster is created.
Sourcepub fn compute_config(self, input: ComputeConfigRequest) -> Self
pub fn compute_config(self, input: ComputeConfigRequest) -> Self
Enable or disable the compute capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your Amazon Web Services account
Sourcepub fn set_compute_config(self, input: Option<ComputeConfigRequest>) -> Self
pub fn set_compute_config(self, input: Option<ComputeConfigRequest>) -> Self
Enable or disable the compute capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your Amazon Web Services account
Sourcepub fn get_compute_config(&self) -> &Option<ComputeConfigRequest>
pub fn get_compute_config(&self) -> &Option<ComputeConfigRequest>
Enable or disable the compute capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your Amazon Web Services account
Sourcepub fn storage_config(self, input: StorageConfigRequest) -> Self
pub fn storage_config(self, input: StorageConfigRequest) -> Self
Enable or disable the block storage capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your Amazon Web Services account.
Sourcepub fn set_storage_config(self, input: Option<StorageConfigRequest>) -> Self
pub fn set_storage_config(self, input: Option<StorageConfigRequest>) -> Self
Enable or disable the block storage capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your Amazon Web Services account.
Sourcepub fn get_storage_config(&self) -> &Option<StorageConfigRequest>
pub fn get_storage_config(&self) -> &Option<StorageConfigRequest>
Enable or disable the block storage capability of EKS Auto Mode when creating your EKS Auto Mode cluster. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your Amazon Web Services account.
Sourcepub fn deletion_protection(self, input: bool) -> Self
pub fn deletion_protection(self, input: bool) -> Self
Indicates whether to enable deletion protection for the cluster. When enabled, the cluster cannot be deleted unless deletion protection is first disabled. This helps prevent accidental cluster deletion. Default value is false
.
Sourcepub fn set_deletion_protection(self, input: Option<bool>) -> Self
pub fn set_deletion_protection(self, input: Option<bool>) -> Self
Indicates whether to enable deletion protection for the cluster. When enabled, the cluster cannot be deleted unless deletion protection is first disabled. This helps prevent accidental cluster deletion. Default value is false
.
Sourcepub fn get_deletion_protection(&self) -> &Option<bool>
pub fn get_deletion_protection(&self) -> &Option<bool>
Indicates whether to enable deletion protection for the cluster. When enabled, the cluster cannot be deleted unless deletion protection is first disabled. This helps prevent accidental cluster deletion. Default value is false
.
Trait Implementations§
Source§impl Clone for CreateClusterFluentBuilder
impl Clone for CreateClusterFluentBuilder
Source§fn clone(&self) -> CreateClusterFluentBuilder
fn clone(&self) -> CreateClusterFluentBuilder
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 CreateClusterFluentBuilder
impl !RefUnwindSafe for CreateClusterFluentBuilder
impl Send for CreateClusterFluentBuilder
impl Sync for CreateClusterFluentBuilder
impl Unpin for CreateClusterFluentBuilder
impl !UnwindSafe for CreateClusterFluentBuilder
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);