pub struct CreateBrokerFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateBroker
.
Creates a broker. Note: This API is asynchronous.
To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy.
-
ec2:CreateNetworkInterface
This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account.
-
ec2:CreateNetworkInterfacePermission
This permission is required to attach the ENI to the broker instance.
-
ec2:DeleteNetworkInterface
-
ec2:DeleteNetworkInterfacePermission
-
ec2:DetachNetworkInterface
-
ec2:DescribeInternetGateways
-
ec2:DescribeNetworkInterfaces
-
ec2:DescribeNetworkInterfacePermissions
-
ec2:DescribeRouteTables
-
ec2:DescribeSecurityGroups
-
ec2:DescribeSubnets
-
ec2:DescribeVpcs
For more information, see Create an IAM User and Get Your Amazon Web Services Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide.
Implementations§
Source§impl CreateBrokerFluentBuilder
impl CreateBrokerFluentBuilder
Sourcepub fn as_input(&self) -> &CreateBrokerInputBuilder
pub fn as_input(&self) -> &CreateBrokerInputBuilder
Access the CreateBroker as a reference.
Sourcepub async fn send(
self,
) -> Result<CreateBrokerOutput, SdkError<CreateBrokerError, HttpResponse>>
pub async fn send( self, ) -> Result<CreateBrokerOutput, SdkError<CreateBrokerError, 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<CreateBrokerOutput, CreateBrokerError, Self>
pub fn customize( self, ) -> CustomizableOperation<CreateBrokerOutput, CreateBrokerError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn authentication_strategy(self, input: AuthenticationStrategy) -> Self
pub fn authentication_strategy(self, input: AuthenticationStrategy) -> Self
Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
Sourcepub fn set_authentication_strategy(
self,
input: Option<AuthenticationStrategy>,
) -> Self
pub fn set_authentication_strategy( self, input: Option<AuthenticationStrategy>, ) -> Self
Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
Sourcepub fn get_authentication_strategy(&self) -> &Option<AuthenticationStrategy>
pub fn get_authentication_strategy(&self) -> &Option<AuthenticationStrategy>
Optional. The authentication strategy used to secure the broker. The default is SIMPLE.
Sourcepub fn auto_minor_version_upgrade(self, input: bool) -> Self
pub fn auto_minor_version_upgrade(self, input: bool) -> Self
Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified.
Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.
Sourcepub fn set_auto_minor_version_upgrade(self, input: Option<bool>) -> Self
pub fn set_auto_minor_version_upgrade(self, input: Option<bool>) -> Self
Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified.
Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.
Sourcepub fn get_auto_minor_version_upgrade(&self) -> &Option<bool>
pub fn get_auto_minor_version_upgrade(&self) -> &Option<bool>
Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified.
Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.
Sourcepub fn broker_name(self, input: impl Into<String>) -> Self
pub fn broker_name(self, input: impl Into<String>) -> Self
Required. The broker's name. This value must be unique in your Amazon Web Services account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters.
Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data.
Sourcepub fn set_broker_name(self, input: Option<String>) -> Self
pub fn set_broker_name(self, input: Option<String>) -> Self
Required. The broker's name. This value must be unique in your Amazon Web Services account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters.
Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data.
Sourcepub fn get_broker_name(&self) -> &Option<String>
pub fn get_broker_name(&self) -> &Option<String>
Required. The broker's name. This value must be unique in your Amazon Web Services account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters.
Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data.
Sourcepub fn configuration(self, input: ConfigurationId) -> Self
pub fn configuration(self, input: ConfigurationId) -> Self
A list of information about the configuration.
Sourcepub fn set_configuration(self, input: Option<ConfigurationId>) -> Self
pub fn set_configuration(self, input: Option<ConfigurationId>) -> Self
A list of information about the configuration.
Sourcepub fn get_configuration(&self) -> &Option<ConfigurationId>
pub fn get_configuration(&self) -> &Option<ConfigurationId>
A list of information about the configuration.
Sourcepub fn creator_request_id(self, input: impl Into<String>) -> Self
pub fn creator_request_id(self, input: impl Into<String>) -> Self
The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action.
We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.
Sourcepub fn set_creator_request_id(self, input: Option<String>) -> Self
pub fn set_creator_request_id(self, input: Option<String>) -> Self
The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action.
We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.
Sourcepub fn get_creator_request_id(&self) -> &Option<String>
pub fn get_creator_request_id(&self) -> &Option<String>
The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action.
We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.
Sourcepub fn deployment_mode(self, input: DeploymentMode) -> Self
pub fn deployment_mode(self, input: DeploymentMode) -> Self
Required. The broker's deployment mode.
Sourcepub fn set_deployment_mode(self, input: Option<DeploymentMode>) -> Self
pub fn set_deployment_mode(self, input: Option<DeploymentMode>) -> Self
Required. The broker's deployment mode.
Sourcepub fn get_deployment_mode(&self) -> &Option<DeploymentMode>
pub fn get_deployment_mode(&self) -> &Option<DeploymentMode>
Required. The broker's deployment mode.
Sourcepub fn encryption_options(self, input: EncryptionOptions) -> Self
pub fn encryption_options(self, input: EncryptionOptions) -> Self
Encryption options for the broker.
Sourcepub fn set_encryption_options(self, input: Option<EncryptionOptions>) -> Self
pub fn set_encryption_options(self, input: Option<EncryptionOptions>) -> Self
Encryption options for the broker.
Sourcepub fn get_encryption_options(&self) -> &Option<EncryptionOptions>
pub fn get_encryption_options(&self) -> &Option<EncryptionOptions>
Encryption options for the broker.
Sourcepub fn engine_type(self, input: EngineType) -> Self
pub fn engine_type(self, input: EngineType) -> Self
Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.
Sourcepub fn set_engine_type(self, input: Option<EngineType>) -> Self
pub fn set_engine_type(self, input: Option<EngineType>) -> Self
Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.
Sourcepub fn get_engine_type(&self) -> &Option<EngineType>
pub fn get_engine_type(&self) -> &Option<EngineType>
Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.
Sourcepub fn engine_version(self, input: impl Into<String>) -> Self
pub fn engine_version(self, input: impl Into<String>) -> Self
The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
Sourcepub fn set_engine_version(self, input: Option<String>) -> Self
pub fn set_engine_version(self, input: Option<String>) -> Self
The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
Sourcepub fn get_engine_version(&self) -> &Option<String>
pub fn get_engine_version(&self) -> &Option<String>
The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.
Sourcepub fn host_instance_type(self, input: impl Into<String>) -> Self
pub fn host_instance_type(self, input: impl Into<String>) -> Self
Required. The broker's instance type.
Sourcepub fn set_host_instance_type(self, input: Option<String>) -> Self
pub fn set_host_instance_type(self, input: Option<String>) -> Self
Required. The broker's instance type.
Sourcepub fn get_host_instance_type(&self) -> &Option<String>
pub fn get_host_instance_type(&self) -> &Option<String>
Required. The broker's instance type.
Sourcepub fn ldap_server_metadata(self, input: LdapServerMetadataInput) -> Self
pub fn ldap_server_metadata(self, input: LdapServerMetadataInput) -> Self
Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
Sourcepub fn set_ldap_server_metadata(
self,
input: Option<LdapServerMetadataInput>,
) -> Self
pub fn set_ldap_server_metadata( self, input: Option<LdapServerMetadataInput>, ) -> Self
Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
Sourcepub fn get_ldap_server_metadata(&self) -> &Option<LdapServerMetadataInput>
pub fn get_ldap_server_metadata(&self) -> &Option<LdapServerMetadataInput>
Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
Sourcepub fn set_logs(self, input: Option<Logs>) -> Self
pub fn set_logs(self, input: Option<Logs>) -> Self
Enables Amazon CloudWatch logging for brokers.
Sourcepub fn maintenance_window_start_time(self, input: WeeklyStartTime) -> Self
pub fn maintenance_window_start_time(self, input: WeeklyStartTime) -> Self
The parameters that determine the WeeklyStartTime.
Sourcepub fn set_maintenance_window_start_time(
self,
input: Option<WeeklyStartTime>,
) -> Self
pub fn set_maintenance_window_start_time( self, input: Option<WeeklyStartTime>, ) -> Self
The parameters that determine the WeeklyStartTime.
Sourcepub fn get_maintenance_window_start_time(&self) -> &Option<WeeklyStartTime>
pub fn get_maintenance_window_start_time(&self) -> &Option<WeeklyStartTime>
The parameters that determine the WeeklyStartTime.
Sourcepub fn publicly_accessible(self, input: bool) -> Self
pub fn publicly_accessible(self, input: bool) -> Self
Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided.
Sourcepub fn set_publicly_accessible(self, input: Option<bool>) -> Self
pub fn set_publicly_accessible(self, input: Option<bool>) -> Self
Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided.
Sourcepub fn get_publicly_accessible(&self) -> &Option<bool>
pub fn get_publicly_accessible(&self) -> &Option<bool>
Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided.
Sourcepub fn security_groups(self, input: impl Into<String>) -> Self
pub fn security_groups(self, input: impl Into<String>) -> Self
Appends an item to SecurityGroups
.
To override the contents of this collection use set_security_groups
.
The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.
Sourcepub fn set_security_groups(self, input: Option<Vec<String>>) -> Self
pub fn set_security_groups(self, input: Option<Vec<String>>) -> Self
The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.
Sourcepub fn get_security_groups(&self) -> &Option<Vec<String>>
pub fn get_security_groups(&self) -> &Option<Vec<String>>
The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.
Sourcepub fn storage_type(self, input: BrokerStorageType) -> Self
pub fn storage_type(self, input: BrokerStorageType) -> Self
The broker's storage type.
Sourcepub fn set_storage_type(self, input: Option<BrokerStorageType>) -> Self
pub fn set_storage_type(self, input: Option<BrokerStorageType>) -> Self
The broker's storage type.
Sourcepub fn get_storage_type(&self) -> &Option<BrokerStorageType>
pub fn get_storage_type(&self) -> &Option<BrokerStorageType>
The broker's storage type.
Sourcepub fn subnet_ids(self, input: impl Into<String>) -> Self
pub fn subnet_ids(self, input: impl Into<String>) -> Self
Appends an item to SubnetIds
.
To override the contents of this collection use set_subnet_ids
.
The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet.
If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your Amazon Web Services account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your Amazon Web Services account.
Sourcepub fn set_subnet_ids(self, input: Option<Vec<String>>) -> Self
pub fn set_subnet_ids(self, input: Option<Vec<String>>) -> Self
The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet.
If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your Amazon Web Services account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your Amazon Web Services account.
Sourcepub fn get_subnet_ids(&self) -> &Option<Vec<String>>
pub fn get_subnet_ids(&self) -> &Option<Vec<String>>
The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet.
If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your Amazon Web Services account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your Amazon Web Services account.
Adds a key-value pair to Tags
.
To override the contents of this collection use set_tags
.
Create tags when creating the broker.
Create tags when creating the broker.
Create tags when creating the broker.
Sourcepub fn users(self, input: User) -> Self
pub fn users(self, input: User) -> Self
Appends an item to Users
.
To override the contents of this collection use set_users
.
The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.
Sourcepub fn set_users(self, input: Option<Vec<User>>) -> Self
pub fn set_users(self, input: Option<Vec<User>>) -> Self
The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.
Sourcepub fn get_users(&self) -> &Option<Vec<User>>
pub fn get_users(&self) -> &Option<Vec<User>>
The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.
Sourcepub fn data_replication_mode(self, input: DataReplicationMode) -> Self
pub fn data_replication_mode(self, input: DataReplicationMode) -> Self
Defines whether this broker is a part of a data replication pair.
Sourcepub fn set_data_replication_mode(
self,
input: Option<DataReplicationMode>,
) -> Self
pub fn set_data_replication_mode( self, input: Option<DataReplicationMode>, ) -> Self
Defines whether this broker is a part of a data replication pair.
Sourcepub fn get_data_replication_mode(&self) -> &Option<DataReplicationMode>
pub fn get_data_replication_mode(&self) -> &Option<DataReplicationMode>
Defines whether this broker is a part of a data replication pair.
Sourcepub fn data_replication_primary_broker_arn(
self,
input: impl Into<String>,
) -> Self
pub fn data_replication_primary_broker_arn( self, input: impl Into<String>, ) -> Self
The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR.
Sourcepub fn set_data_replication_primary_broker_arn(
self,
input: Option<String>,
) -> Self
pub fn set_data_replication_primary_broker_arn( self, input: Option<String>, ) -> Self
The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR.
Sourcepub fn get_data_replication_primary_broker_arn(&self) -> &Option<String>
pub fn get_data_replication_primary_broker_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR.
Trait Implementations§
Source§impl Clone for CreateBrokerFluentBuilder
impl Clone for CreateBrokerFluentBuilder
Source§fn clone(&self) -> CreateBrokerFluentBuilder
fn clone(&self) -> CreateBrokerFluentBuilder
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 CreateBrokerFluentBuilder
impl !RefUnwindSafe for CreateBrokerFluentBuilder
impl Send for CreateBrokerFluentBuilder
impl Sync for CreateBrokerFluentBuilder
impl Unpin for CreateBrokerFluentBuilder
impl !UnwindSafe for CreateBrokerFluentBuilder
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);