#[non_exhaustive]pub struct CreatePredictorInputBuilder { /* private fields */ }
Expand description
A builder for CreatePredictorInput
.
Implementations§
Source§impl CreatePredictorInputBuilder
impl CreatePredictorInputBuilder
Sourcepub fn predictor_name(self, input: impl Into<String>) -> Self
pub fn predictor_name(self, input: impl Into<String>) -> Self
A name for the predictor.
This field is required.Sourcepub fn set_predictor_name(self, input: Option<String>) -> Self
pub fn set_predictor_name(self, input: Option<String>) -> Self
A name for the predictor.
Sourcepub fn get_predictor_name(&self) -> &Option<String>
pub fn get_predictor_name(&self) -> &Option<String>
A name for the predictor.
Sourcepub fn algorithm_arn(self, input: impl Into<String>) -> Self
pub fn algorithm_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the algorithm to use for model training. Required if PerformAutoML
is not set to true
.
Supported algorithms:
-
arn:aws:forecast:::algorithm/ARIMA
-
arn:aws:forecast:::algorithm/CNN-QR
-
arn:aws:forecast:::algorithm/Deep_AR_Plus
-
arn:aws:forecast:::algorithm/ETS
-
arn:aws:forecast:::algorithm/NPTS
-
arn:aws:forecast:::algorithm/Prophet
Sourcepub fn set_algorithm_arn(self, input: Option<String>) -> Self
pub fn set_algorithm_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the algorithm to use for model training. Required if PerformAutoML
is not set to true
.
Supported algorithms:
-
arn:aws:forecast:::algorithm/ARIMA
-
arn:aws:forecast:::algorithm/CNN-QR
-
arn:aws:forecast:::algorithm/Deep_AR_Plus
-
arn:aws:forecast:::algorithm/ETS
-
arn:aws:forecast:::algorithm/NPTS
-
arn:aws:forecast:::algorithm/Prophet
Sourcepub fn get_algorithm_arn(&self) -> &Option<String>
pub fn get_algorithm_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the algorithm to use for model training. Required if PerformAutoML
is not set to true
.
Supported algorithms:
-
arn:aws:forecast:::algorithm/ARIMA
-
arn:aws:forecast:::algorithm/CNN-QR
-
arn:aws:forecast:::algorithm/Deep_AR_Plus
-
arn:aws:forecast:::algorithm/ETS
-
arn:aws:forecast:::algorithm/NPTS
-
arn:aws:forecast:::algorithm/Prophet
Sourcepub fn forecast_horizon(self, input: i32) -> Self
pub fn forecast_horizon(self, input: i32) -> Self
Specifies the number of time-steps that the model is trained to predict. The forecast horizon is also called the prediction length.
For example, if you configure a dataset for daily data collection (using the DataFrequency
parameter of the CreateDataset
operation) and set the forecast horizon to 10, the model returns predictions for 10 days.
The maximum forecast horizon is the lesser of 500 time-steps or 1/3 of the TARGET_TIME_SERIES dataset length.
This field is required.Sourcepub fn set_forecast_horizon(self, input: Option<i32>) -> Self
pub fn set_forecast_horizon(self, input: Option<i32>) -> Self
Specifies the number of time-steps that the model is trained to predict. The forecast horizon is also called the prediction length.
For example, if you configure a dataset for daily data collection (using the DataFrequency
parameter of the CreateDataset
operation) and set the forecast horizon to 10, the model returns predictions for 10 days.
The maximum forecast horizon is the lesser of 500 time-steps or 1/3 of the TARGET_TIME_SERIES dataset length.
Sourcepub fn get_forecast_horizon(&self) -> &Option<i32>
pub fn get_forecast_horizon(&self) -> &Option<i32>
Specifies the number of time-steps that the model is trained to predict. The forecast horizon is also called the prediction length.
For example, if you configure a dataset for daily data collection (using the DataFrequency
parameter of the CreateDataset
operation) and set the forecast horizon to 10, the model returns predictions for 10 days.
The maximum forecast horizon is the lesser of 500 time-steps or 1/3 of the TARGET_TIME_SERIES dataset length.
Sourcepub fn forecast_types(self, input: impl Into<String>) -> Self
pub fn forecast_types(self, input: impl Into<String>) -> Self
Appends an item to forecast_types
.
To override the contents of this collection use set_forecast_types
.
Specifies the forecast types used to train a predictor. You can specify up to five forecast types. Forecast types can be quantiles from 0.01 to 0.99, by increments of 0.01 or higher. You can also specify the mean forecast with mean
.
The default value is \["0.10", "0.50", "0.9"\]
.
Sourcepub fn set_forecast_types(self, input: Option<Vec<String>>) -> Self
pub fn set_forecast_types(self, input: Option<Vec<String>>) -> Self
Specifies the forecast types used to train a predictor. You can specify up to five forecast types. Forecast types can be quantiles from 0.01 to 0.99, by increments of 0.01 or higher. You can also specify the mean forecast with mean
.
The default value is \["0.10", "0.50", "0.9"\]
.
Sourcepub fn get_forecast_types(&self) -> &Option<Vec<String>>
pub fn get_forecast_types(&self) -> &Option<Vec<String>>
Specifies the forecast types used to train a predictor. You can specify up to five forecast types. Forecast types can be quantiles from 0.01 to 0.99, by increments of 0.01 or higher. You can also specify the mean forecast with mean
.
The default value is \["0.10", "0.50", "0.9"\]
.
Sourcepub fn perform_auto_ml(self, input: bool) -> Self
pub fn perform_auto_ml(self, input: bool) -> Self
Whether to perform AutoML. When Amazon Forecast performs AutoML, it evaluates the algorithms it provides and chooses the best algorithm and configuration for your training dataset.
The default value is false
. In this case, you are required to specify an algorithm.
Set PerformAutoML
to true
to have Amazon Forecast perform AutoML. This is a good option if you aren't sure which algorithm is suitable for your training data. In this case, PerformHPO
must be false.
Sourcepub fn set_perform_auto_ml(self, input: Option<bool>) -> Self
pub fn set_perform_auto_ml(self, input: Option<bool>) -> Self
Whether to perform AutoML. When Amazon Forecast performs AutoML, it evaluates the algorithms it provides and chooses the best algorithm and configuration for your training dataset.
The default value is false
. In this case, you are required to specify an algorithm.
Set PerformAutoML
to true
to have Amazon Forecast perform AutoML. This is a good option if you aren't sure which algorithm is suitable for your training data. In this case, PerformHPO
must be false.
Sourcepub fn get_perform_auto_ml(&self) -> &Option<bool>
pub fn get_perform_auto_ml(&self) -> &Option<bool>
Whether to perform AutoML. When Amazon Forecast performs AutoML, it evaluates the algorithms it provides and chooses the best algorithm and configuration for your training dataset.
The default value is false
. In this case, you are required to specify an algorithm.
Set PerformAutoML
to true
to have Amazon Forecast perform AutoML. This is a good option if you aren't sure which algorithm is suitable for your training data. In this case, PerformHPO
must be false.
Sourcepub fn auto_ml_override_strategy(self, input: AutoMlOverrideStrategy) -> Self
pub fn auto_ml_override_strategy(self, input: AutoMlOverrideStrategy) -> Self
The LatencyOptimized
AutoML override strategy is only available in private beta. Contact Amazon Web Services Support or your account manager to learn more about access privileges.
Used to overide the default AutoML strategy, which is to optimize predictor accuracy. To apply an AutoML strategy that minimizes training time, use LatencyOptimized
.
This parameter is only valid for predictors trained using AutoML.
Sourcepub fn set_auto_ml_override_strategy(
self,
input: Option<AutoMlOverrideStrategy>,
) -> Self
pub fn set_auto_ml_override_strategy( self, input: Option<AutoMlOverrideStrategy>, ) -> Self
The LatencyOptimized
AutoML override strategy is only available in private beta. Contact Amazon Web Services Support or your account manager to learn more about access privileges.
Used to overide the default AutoML strategy, which is to optimize predictor accuracy. To apply an AutoML strategy that minimizes training time, use LatencyOptimized
.
This parameter is only valid for predictors trained using AutoML.
Sourcepub fn get_auto_ml_override_strategy(&self) -> &Option<AutoMlOverrideStrategy>
pub fn get_auto_ml_override_strategy(&self) -> &Option<AutoMlOverrideStrategy>
The LatencyOptimized
AutoML override strategy is only available in private beta. Contact Amazon Web Services Support or your account manager to learn more about access privileges.
Used to overide the default AutoML strategy, which is to optimize predictor accuracy. To apply an AutoML strategy that minimizes training time, use LatencyOptimized
.
This parameter is only valid for predictors trained using AutoML.
Sourcepub fn perform_hpo(self, input: bool) -> Self
pub fn perform_hpo(self, input: bool) -> Self
Whether to perform hyperparameter optimization (HPO). HPO finds optimal hyperparameter values for your training data. The process of performing HPO is known as running a hyperparameter tuning job.
The default value is false
. In this case, Amazon Forecast uses default hyperparameter values from the chosen algorithm.
To override the default values, set PerformHPO
to true
and, optionally, supply the HyperParameterTuningJobConfig
object. The tuning job specifies a metric to optimize, which hyperparameters participate in tuning, and the valid range for each tunable hyperparameter. In this case, you are required to specify an algorithm and PerformAutoML
must be false.
The following algorithms support HPO:
-
DeepAR+
-
CNN-QR
Sourcepub fn set_perform_hpo(self, input: Option<bool>) -> Self
pub fn set_perform_hpo(self, input: Option<bool>) -> Self
Whether to perform hyperparameter optimization (HPO). HPO finds optimal hyperparameter values for your training data. The process of performing HPO is known as running a hyperparameter tuning job.
The default value is false
. In this case, Amazon Forecast uses default hyperparameter values from the chosen algorithm.
To override the default values, set PerformHPO
to true
and, optionally, supply the HyperParameterTuningJobConfig
object. The tuning job specifies a metric to optimize, which hyperparameters participate in tuning, and the valid range for each tunable hyperparameter. In this case, you are required to specify an algorithm and PerformAutoML
must be false.
The following algorithms support HPO:
-
DeepAR+
-
CNN-QR
Sourcepub fn get_perform_hpo(&self) -> &Option<bool>
pub fn get_perform_hpo(&self) -> &Option<bool>
Whether to perform hyperparameter optimization (HPO). HPO finds optimal hyperparameter values for your training data. The process of performing HPO is known as running a hyperparameter tuning job.
The default value is false
. In this case, Amazon Forecast uses default hyperparameter values from the chosen algorithm.
To override the default values, set PerformHPO
to true
and, optionally, supply the HyperParameterTuningJobConfig
object. The tuning job specifies a metric to optimize, which hyperparameters participate in tuning, and the valid range for each tunable hyperparameter. In this case, you are required to specify an algorithm and PerformAutoML
must be false.
The following algorithms support HPO:
-
DeepAR+
-
CNN-QR
Sourcepub fn training_parameters(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn training_parameters( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to training_parameters
.
To override the contents of this collection use set_training_parameters
.
The hyperparameters to override for model training. The hyperparameters that you can override are listed in the individual algorithms. For the list of supported algorithms, see aws-forecast-choosing-recipes
.
Sourcepub fn set_training_parameters(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_training_parameters( self, input: Option<HashMap<String, String>>, ) -> Self
The hyperparameters to override for model training. The hyperparameters that you can override are listed in the individual algorithms. For the list of supported algorithms, see aws-forecast-choosing-recipes
.
Sourcepub fn get_training_parameters(&self) -> &Option<HashMap<String, String>>
pub fn get_training_parameters(&self) -> &Option<HashMap<String, String>>
The hyperparameters to override for model training. The hyperparameters that you can override are listed in the individual algorithms. For the list of supported algorithms, see aws-forecast-choosing-recipes
.
Sourcepub fn evaluation_parameters(self, input: EvaluationParameters) -> Self
pub fn evaluation_parameters(self, input: EvaluationParameters) -> Self
Used to override the default evaluation parameters of the specified algorithm. Amazon Forecast evaluates a predictor by splitting a dataset into training data and testing data. The evaluation parameters define how to perform the split and the number of iterations.
Sourcepub fn set_evaluation_parameters(
self,
input: Option<EvaluationParameters>,
) -> Self
pub fn set_evaluation_parameters( self, input: Option<EvaluationParameters>, ) -> Self
Used to override the default evaluation parameters of the specified algorithm. Amazon Forecast evaluates a predictor by splitting a dataset into training data and testing data. The evaluation parameters define how to perform the split and the number of iterations.
Sourcepub fn get_evaluation_parameters(&self) -> &Option<EvaluationParameters>
pub fn get_evaluation_parameters(&self) -> &Option<EvaluationParameters>
Used to override the default evaluation parameters of the specified algorithm. Amazon Forecast evaluates a predictor by splitting a dataset into training data and testing data. The evaluation parameters define how to perform the split and the number of iterations.
Sourcepub fn hpo_config(self, input: HyperParameterTuningJobConfig) -> Self
pub fn hpo_config(self, input: HyperParameterTuningJobConfig) -> Self
Provides hyperparameter override values for the algorithm. If you don't provide this parameter, Amazon Forecast uses default values. The individual algorithms specify which hyperparameters support hyperparameter optimization (HPO). For more information, see aws-forecast-choosing-recipes
.
If you included the HPOConfig
object, you must set PerformHPO
to true.
Sourcepub fn set_hpo_config(
self,
input: Option<HyperParameterTuningJobConfig>,
) -> Self
pub fn set_hpo_config( self, input: Option<HyperParameterTuningJobConfig>, ) -> Self
Provides hyperparameter override values for the algorithm. If you don't provide this parameter, Amazon Forecast uses default values. The individual algorithms specify which hyperparameters support hyperparameter optimization (HPO). For more information, see aws-forecast-choosing-recipes
.
If you included the HPOConfig
object, you must set PerformHPO
to true.
Sourcepub fn get_hpo_config(&self) -> &Option<HyperParameterTuningJobConfig>
pub fn get_hpo_config(&self) -> &Option<HyperParameterTuningJobConfig>
Provides hyperparameter override values for the algorithm. If you don't provide this parameter, Amazon Forecast uses default values. The individual algorithms specify which hyperparameters support hyperparameter optimization (HPO). For more information, see aws-forecast-choosing-recipes
.
If you included the HPOConfig
object, you must set PerformHPO
to true.
Sourcepub fn input_data_config(self, input: InputDataConfig) -> Self
pub fn input_data_config(self, input: InputDataConfig) -> Self
Describes the dataset group that contains the data to use to train the predictor.
This field is required.Sourcepub fn set_input_data_config(self, input: Option<InputDataConfig>) -> Self
pub fn set_input_data_config(self, input: Option<InputDataConfig>) -> Self
Describes the dataset group that contains the data to use to train the predictor.
Sourcepub fn get_input_data_config(&self) -> &Option<InputDataConfig>
pub fn get_input_data_config(&self) -> &Option<InputDataConfig>
Describes the dataset group that contains the data to use to train the predictor.
Sourcepub fn featurization_config(self, input: FeaturizationConfig) -> Self
pub fn featurization_config(self, input: FeaturizationConfig) -> Self
The featurization configuration.
This field is required.Sourcepub fn set_featurization_config(
self,
input: Option<FeaturizationConfig>,
) -> Self
pub fn set_featurization_config( self, input: Option<FeaturizationConfig>, ) -> Self
The featurization configuration.
Sourcepub fn get_featurization_config(&self) -> &Option<FeaturizationConfig>
pub fn get_featurization_config(&self) -> &Option<FeaturizationConfig>
The featurization configuration.
Sourcepub fn encryption_config(self, input: EncryptionConfig) -> Self
pub fn encryption_config(self, input: EncryptionConfig) -> Self
An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.
Sourcepub fn set_encryption_config(self, input: Option<EncryptionConfig>) -> Self
pub fn set_encryption_config(self, input: Option<EncryptionConfig>) -> Self
An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.
Sourcepub fn get_encryption_config(&self) -> &Option<EncryptionConfig>
pub fn get_encryption_config(&self) -> &Option<EncryptionConfig>
An Key Management Service (KMS) key and the Identity and Access Management (IAM) role that Amazon Forecast can assume to access the key.
Appends an item to tags
.
To override the contents of this collection use set_tags
.
The optional metadata that you apply to the predictor to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.
The following basic restrictions apply to tags:
-
Maximum number of tags per resource - 50.
-
For each resource, each tag key must be unique, and each tag key can have only one value.
-
Maximum key length - 128 Unicode characters in UTF-8.
-
Maximum value length - 256 Unicode characters in UTF-8.
-
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
-
Tag keys and values are case sensitive.
-
Do not use
aws:
,AWS:
, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value hasaws
as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix ofaws
do not count against your tags per resource limit.
The optional metadata that you apply to the predictor to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.
The following basic restrictions apply to tags:
-
Maximum number of tags per resource - 50.
-
For each resource, each tag key must be unique, and each tag key can have only one value.
-
Maximum key length - 128 Unicode characters in UTF-8.
-
Maximum value length - 256 Unicode characters in UTF-8.
-
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
-
Tag keys and values are case sensitive.
-
Do not use
aws:
,AWS:
, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value hasaws
as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix ofaws
do not count against your tags per resource limit.
The optional metadata that you apply to the predictor to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.
The following basic restrictions apply to tags:
-
Maximum number of tags per resource - 50.
-
For each resource, each tag key must be unique, and each tag key can have only one value.
-
Maximum key length - 128 Unicode characters in UTF-8.
-
Maximum value length - 256 Unicode characters in UTF-8.
-
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
-
Tag keys and values are case sensitive.
-
Do not use
aws:
,AWS:
, or any upper or lowercase combination of such as a prefix for keys as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value hasaws
as its prefix but the key does not, then Forecast considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix ofaws
do not count against your tags per resource limit.
Sourcepub fn optimization_metric(self, input: OptimizationMetric) -> Self
pub fn optimization_metric(self, input: OptimizationMetric) -> Self
The accuracy metric used to optimize the predictor.
Sourcepub fn set_optimization_metric(self, input: Option<OptimizationMetric>) -> Self
pub fn set_optimization_metric(self, input: Option<OptimizationMetric>) -> Self
The accuracy metric used to optimize the predictor.
Sourcepub fn get_optimization_metric(&self) -> &Option<OptimizationMetric>
pub fn get_optimization_metric(&self) -> &Option<OptimizationMetric>
The accuracy metric used to optimize the predictor.
Sourcepub fn build(self) -> Result<CreatePredictorInput, BuildError>
pub fn build(self) -> Result<CreatePredictorInput, BuildError>
Consumes the builder and constructs a CreatePredictorInput
.
Source§impl CreatePredictorInputBuilder
impl CreatePredictorInputBuilder
Sourcepub async fn send_with(
self,
client: &Client,
) -> Result<CreatePredictorOutput, SdkError<CreatePredictorError, HttpResponse>>
pub async fn send_with( self, client: &Client, ) -> Result<CreatePredictorOutput, SdkError<CreatePredictorError, HttpResponse>>
Sends a request with this input using the given client.
Trait Implementations§
Source§impl Clone for CreatePredictorInputBuilder
impl Clone for CreatePredictorInputBuilder
Source§fn clone(&self) -> CreatePredictorInputBuilder
fn clone(&self) -> CreatePredictorInputBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CreatePredictorInputBuilder
impl Debug for CreatePredictorInputBuilder
Source§impl Default for CreatePredictorInputBuilder
impl Default for CreatePredictorInputBuilder
Source§fn default() -> CreatePredictorInputBuilder
fn default() -> CreatePredictorInputBuilder
Source§impl PartialEq for CreatePredictorInputBuilder
impl PartialEq for CreatePredictorInputBuilder
Source§fn eq(&self, other: &CreatePredictorInputBuilder) -> bool
fn eq(&self, other: &CreatePredictorInputBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CreatePredictorInputBuilder
Auto Trait Implementations§
impl Freeze for CreatePredictorInputBuilder
impl RefUnwindSafe for CreatePredictorInputBuilder
impl Send for CreatePredictorInputBuilder
impl Sync for CreatePredictorInputBuilder
impl Unpin for CreatePredictorInputBuilder
impl UnwindSafe for CreatePredictorInputBuilder
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);