#[non_exhaustive]pub struct HyperParameterTrainingJobDefinitionBuilder { /* private fields */ }
Expand description
A builder for HyperParameterTrainingJobDefinition
.
Implementations§
Source§impl HyperParameterTrainingJobDefinitionBuilder
impl HyperParameterTrainingJobDefinitionBuilder
Sourcepub fn definition_name(self, input: impl Into<String>) -> Self
pub fn definition_name(self, input: impl Into<String>) -> Self
The job definition name.
Sourcepub fn set_definition_name(self, input: Option<String>) -> Self
pub fn set_definition_name(self, input: Option<String>) -> Self
The job definition name.
Sourcepub fn get_definition_name(&self) -> &Option<String>
pub fn get_definition_name(&self) -> &Option<String>
The job definition name.
Sourcepub fn tuning_objective(self, input: HyperParameterTuningJobObjective) -> Self
pub fn tuning_objective(self, input: HyperParameterTuningJobObjective) -> Self
Defines the objective metric for a hyperparameter tuning job. Hyperparameter tuning uses the value of this metric to evaluate the training jobs it launches, and returns the training job that results in either the highest or lowest value for this metric, depending on the value you specify for the Type
parameter. If you want to define a custom objective metric, see Define metrics and environment variables.
Sourcepub fn set_tuning_objective(
self,
input: Option<HyperParameterTuningJobObjective>,
) -> Self
pub fn set_tuning_objective( self, input: Option<HyperParameterTuningJobObjective>, ) -> Self
Defines the objective metric for a hyperparameter tuning job. Hyperparameter tuning uses the value of this metric to evaluate the training jobs it launches, and returns the training job that results in either the highest or lowest value for this metric, depending on the value you specify for the Type
parameter. If you want to define a custom objective metric, see Define metrics and environment variables.
Sourcepub fn get_tuning_objective(&self) -> &Option<HyperParameterTuningJobObjective>
pub fn get_tuning_objective(&self) -> &Option<HyperParameterTuningJobObjective>
Defines the objective metric for a hyperparameter tuning job. Hyperparameter tuning uses the value of this metric to evaluate the training jobs it launches, and returns the training job that results in either the highest or lowest value for this metric, depending on the value you specify for the Type
parameter. If you want to define a custom objective metric, see Define metrics and environment variables.
Sourcepub fn hyper_parameter_ranges(self, input: ParameterRanges) -> Self
pub fn hyper_parameter_ranges(self, input: ParameterRanges) -> Self
Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.
The maximum number of items specified for Array Members
refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.
Sourcepub fn set_hyper_parameter_ranges(self, input: Option<ParameterRanges>) -> Self
pub fn set_hyper_parameter_ranges(self, input: Option<ParameterRanges>) -> Self
Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.
The maximum number of items specified for Array Members
refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.
Sourcepub fn get_hyper_parameter_ranges(&self) -> &Option<ParameterRanges>
pub fn get_hyper_parameter_ranges(&self) -> &Option<ParameterRanges>
Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.
The maximum number of items specified for Array Members
refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.
Sourcepub fn static_hyper_parameters(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn static_hyper_parameters( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to static_hyper_parameters
.
To override the contents of this collection use set_static_hyper_parameters
.
Specifies the values of hyperparameters that do not change for the tuning job.
Sourcepub fn set_static_hyper_parameters(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_static_hyper_parameters( self, input: Option<HashMap<String, String>>, ) -> Self
Specifies the values of hyperparameters that do not change for the tuning job.
Sourcepub fn get_static_hyper_parameters(&self) -> &Option<HashMap<String, String>>
pub fn get_static_hyper_parameters(&self) -> &Option<HashMap<String, String>>
Specifies the values of hyperparameters that do not change for the tuning job.
Sourcepub fn algorithm_specification(
self,
input: HyperParameterAlgorithmSpecification,
) -> Self
pub fn algorithm_specification( self, input: HyperParameterAlgorithmSpecification, ) -> Self
The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
This field is required.Sourcepub fn set_algorithm_specification(
self,
input: Option<HyperParameterAlgorithmSpecification>,
) -> Self
pub fn set_algorithm_specification( self, input: Option<HyperParameterAlgorithmSpecification>, ) -> Self
The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
Sourcepub fn get_algorithm_specification(
&self,
) -> &Option<HyperParameterAlgorithmSpecification>
pub fn get_algorithm_specification( &self, ) -> &Option<HyperParameterAlgorithmSpecification>
The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
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 associated with the training jobs that the tuning job launches.
This field is required.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 associated with the training jobs that the tuning job launches.
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 associated with the training jobs that the tuning job launches.
Sourcepub fn input_data_config(self, input: Channel) -> Self
pub fn input_data_config(self, input: Channel) -> Self
Appends an item to input_data_config
.
To override the contents of this collection use set_input_data_config
.
An array of Channel objects that specify the input for the training jobs that the tuning job launches.
Sourcepub fn set_input_data_config(self, input: Option<Vec<Channel>>) -> Self
pub fn set_input_data_config(self, input: Option<Vec<Channel>>) -> Self
An array of Channel objects that specify the input for the training jobs that the tuning job launches.
Sourcepub fn get_input_data_config(&self) -> &Option<Vec<Channel>>
pub fn get_input_data_config(&self) -> &Option<Vec<Channel>>
An array of Channel objects that specify the input for the training jobs that the tuning job launches.
Sourcepub fn vpc_config(self, input: VpcConfig) -> Self
pub fn vpc_config(self, input: VpcConfig) -> Self
The VpcConfig object that specifies the VPC that you want the training jobs that this hyperparameter tuning job launches to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.
Sourcepub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
pub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
The VpcConfig object that specifies the VPC that you want the training jobs that this hyperparameter tuning job launches to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.
Sourcepub fn get_vpc_config(&self) -> &Option<VpcConfig>
pub fn get_vpc_config(&self) -> &Option<VpcConfig>
The VpcConfig object that specifies the VPC that you want the training jobs that this hyperparameter tuning job launches to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.
Sourcepub fn output_data_config(self, input: OutputDataConfig) -> Self
pub fn output_data_config(self, input: OutputDataConfig) -> Self
Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.
This field is required.Sourcepub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
pub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.
Sourcepub fn get_output_data_config(&self) -> &Option<OutputDataConfig>
pub fn get_output_data_config(&self) -> &Option<OutputDataConfig>
Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.
Sourcepub fn resource_config(self, input: ResourceConfig) -> Self
pub fn resource_config(self, input: ResourceConfig) -> Self
The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.
Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want SageMaker to use the storage volume to store the training data, choose File
as the TrainingInputMode
in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.
If you want to use hyperparameter optimization with instance type flexibility, use HyperParameterTuningResourceConfig
instead.
Sourcepub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
pub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.
Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want SageMaker to use the storage volume to store the training data, choose File
as the TrainingInputMode
in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.
If you want to use hyperparameter optimization with instance type flexibility, use HyperParameterTuningResourceConfig
instead.
Sourcepub fn get_resource_config(&self) -> &Option<ResourceConfig>
pub fn get_resource_config(&self) -> &Option<ResourceConfig>
The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.
Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want SageMaker to use the storage volume to store the training data, choose File
as the TrainingInputMode
in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.
If you want to use hyperparameter optimization with instance type flexibility, use HyperParameterTuningResourceConfig
instead.
Sourcepub fn hyper_parameter_tuning_resource_config(
self,
input: HyperParameterTuningResourceConfig,
) -> Self
pub fn hyper_parameter_tuning_resource_config( self, input: HyperParameterTuningResourceConfig, ) -> Self
The configuration for the hyperparameter tuning resources, including the compute instances and storage volumes, used for training jobs launched by the tuning job. By default, storage volumes hold model artifacts and incremental states. Choose File
for TrainingInputMode
in the AlgorithmSpecification
parameter to additionally store training data in the storage volume (optional).
Sourcepub fn set_hyper_parameter_tuning_resource_config(
self,
input: Option<HyperParameterTuningResourceConfig>,
) -> Self
pub fn set_hyper_parameter_tuning_resource_config( self, input: Option<HyperParameterTuningResourceConfig>, ) -> Self
The configuration for the hyperparameter tuning resources, including the compute instances and storage volumes, used for training jobs launched by the tuning job. By default, storage volumes hold model artifacts and incremental states. Choose File
for TrainingInputMode
in the AlgorithmSpecification
parameter to additionally store training data in the storage volume (optional).
Sourcepub fn get_hyper_parameter_tuning_resource_config(
&self,
) -> &Option<HyperParameterTuningResourceConfig>
pub fn get_hyper_parameter_tuning_resource_config( &self, ) -> &Option<HyperParameterTuningResourceConfig>
The configuration for the hyperparameter tuning resources, including the compute instances and storage volumes, used for training jobs launched by the tuning job. By default, storage volumes hold model artifacts and incremental states. Choose File
for TrainingInputMode
in the AlgorithmSpecification
parameter to additionally store training data in the storage volume (optional).
Sourcepub fn stopping_condition(self, input: StoppingCondition) -> Self
pub fn stopping_condition(self, input: StoppingCondition) -> Self
Specifies a limit to how long a model hyperparameter training job can run. It also specifies how long a managed spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.
This field is required.Sourcepub fn set_stopping_condition(self, input: Option<StoppingCondition>) -> Self
pub fn set_stopping_condition(self, input: Option<StoppingCondition>) -> Self
Specifies a limit to how long a model hyperparameter training job can run. It also specifies how long a managed spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.
Sourcepub fn get_stopping_condition(&self) -> &Option<StoppingCondition>
pub fn get_stopping_condition(&self) -> &Option<StoppingCondition>
Specifies a limit to how long a model hyperparameter training job can run. It also specifies how long a managed spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.
Sourcepub fn enable_network_isolation(self, input: bool) -> Self
pub fn enable_network_isolation(self, input: bool) -> Self
Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If network isolation is used for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.
Sourcepub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
pub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If network isolation is used for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.
Sourcepub fn get_enable_network_isolation(&self) -> &Option<bool>
pub fn get_enable_network_isolation(&self) -> &Option<bool>
Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If network isolation is used for training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.
Sourcepub fn enable_inter_container_traffic_encryption(self, input: bool) -> Self
pub fn enable_inter_container_traffic_encryption(self, input: bool) -> Self
To encrypt all communications between ML compute instances in distributed training, choose True
. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.
Sourcepub fn set_enable_inter_container_traffic_encryption(
self,
input: Option<bool>,
) -> Self
pub fn set_enable_inter_container_traffic_encryption( self, input: Option<bool>, ) -> Self
To encrypt all communications between ML compute instances in distributed training, choose True
. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.
Sourcepub fn get_enable_inter_container_traffic_encryption(&self) -> &Option<bool>
pub fn get_enable_inter_container_traffic_encryption(&self) -> &Option<bool>
To encrypt all communications between ML compute instances in distributed training, choose True
. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.
Sourcepub fn enable_managed_spot_training(self, input: bool) -> Self
pub fn enable_managed_spot_training(self, input: bool) -> Self
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
Sourcepub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
pub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
Sourcepub fn get_enable_managed_spot_training(&self) -> &Option<bool>
pub fn get_enable_managed_spot_training(&self) -> &Option<bool>
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
Sourcepub fn checkpoint_config(self, input: CheckpointConfig) -> Self
pub fn checkpoint_config(self, input: CheckpointConfig) -> Self
Contains information about the output location for managed spot training checkpoint data.
Sourcepub fn set_checkpoint_config(self, input: Option<CheckpointConfig>) -> Self
pub fn set_checkpoint_config(self, input: Option<CheckpointConfig>) -> Self
Contains information about the output location for managed spot training checkpoint data.
Sourcepub fn get_checkpoint_config(&self) -> &Option<CheckpointConfig>
pub fn get_checkpoint_config(&self) -> &Option<CheckpointConfig>
Contains information about the output location for managed spot training checkpoint data.
Sourcepub fn retry_strategy(self, input: RetryStrategy) -> Self
pub fn retry_strategy(self, input: RetryStrategy) -> Self
The number of times to retry the job when the job fails due to an InternalServerError
.
Sourcepub fn set_retry_strategy(self, input: Option<RetryStrategy>) -> Self
pub fn set_retry_strategy(self, input: Option<RetryStrategy>) -> Self
The number of times to retry the job when the job fails due to an InternalServerError
.
Sourcepub fn get_retry_strategy(&self) -> &Option<RetryStrategy>
pub fn get_retry_strategy(&self) -> &Option<RetryStrategy>
The number of times to retry the job when the job fails due to an InternalServerError
.
Sourcepub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to environment
.
To override the contents of this collection use set_environment
.
An environment variable that you can pass into the SageMaker CreateTrainingJob API. You can use an existing environment variable from the training container or use your own. See Define metrics and variables for more information.
The maximum number of items specified for Map Entries
refers to the maximum number of environment variables for each TrainingJobDefinition
and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of environment variables for all the training job definitions can't exceed the maximum number specified.
Sourcepub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
An environment variable that you can pass into the SageMaker CreateTrainingJob API. You can use an existing environment variable from the training container or use your own. See Define metrics and variables for more information.
The maximum number of items specified for Map Entries
refers to the maximum number of environment variables for each TrainingJobDefinition
and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of environment variables for all the training job definitions can't exceed the maximum number specified.
Sourcepub fn get_environment(&self) -> &Option<HashMap<String, String>>
pub fn get_environment(&self) -> &Option<HashMap<String, String>>
An environment variable that you can pass into the SageMaker CreateTrainingJob API. You can use an existing environment variable from the training container or use your own. See Define metrics and variables for more information.
The maximum number of items specified for Map Entries
refers to the maximum number of environment variables for each TrainingJobDefinition
and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of environment variables for all the training job definitions can't exceed the maximum number specified.
Sourcepub fn build(self) -> HyperParameterTrainingJobDefinition
pub fn build(self) -> HyperParameterTrainingJobDefinition
Consumes the builder and constructs a HyperParameterTrainingJobDefinition
.
Trait Implementations§
Source§impl Clone for HyperParameterTrainingJobDefinitionBuilder
impl Clone for HyperParameterTrainingJobDefinitionBuilder
Source§fn clone(&self) -> HyperParameterTrainingJobDefinitionBuilder
fn clone(&self) -> HyperParameterTrainingJobDefinitionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for HyperParameterTrainingJobDefinitionBuilder
impl Default for HyperParameterTrainingJobDefinitionBuilder
Source§fn default() -> HyperParameterTrainingJobDefinitionBuilder
fn default() -> HyperParameterTrainingJobDefinitionBuilder
Source§impl PartialEq for HyperParameterTrainingJobDefinitionBuilder
impl PartialEq for HyperParameterTrainingJobDefinitionBuilder
Source§fn eq(&self, other: &HyperParameterTrainingJobDefinitionBuilder) -> bool
fn eq(&self, other: &HyperParameterTrainingJobDefinitionBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for HyperParameterTrainingJobDefinitionBuilder
Auto Trait Implementations§
impl Freeze for HyperParameterTrainingJobDefinitionBuilder
impl RefUnwindSafe for HyperParameterTrainingJobDefinitionBuilder
impl Send for HyperParameterTrainingJobDefinitionBuilder
impl Sync for HyperParameterTrainingJobDefinitionBuilder
impl Unpin for HyperParameterTrainingJobDefinitionBuilder
impl UnwindSafe for HyperParameterTrainingJobDefinitionBuilder
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);