pub struct CreateAppFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to CreateApp
.
Creates a new Amplify app.
Implementations§
Source§impl CreateAppFluentBuilder
impl CreateAppFluentBuilder
Sourcepub fn as_input(&self) -> &CreateAppInputBuilder
pub fn as_input(&self) -> &CreateAppInputBuilder
Access the CreateApp as a reference.
Sourcepub async fn send(
self,
) -> Result<CreateAppOutput, SdkError<CreateAppError, HttpResponse>>
pub async fn send( self, ) -> Result<CreateAppOutput, SdkError<CreateAppError, 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<CreateAppOutput, CreateAppError, Self>
pub fn customize( self, ) -> CustomizableOperation<CreateAppOutput, CreateAppError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn description(self, input: impl Into<String>) -> Self
pub fn description(self, input: impl Into<String>) -> Self
The description of the Amplify app.
Sourcepub fn set_description(self, input: Option<String>) -> Self
pub fn set_description(self, input: Option<String>) -> Self
The description of the Amplify app.
Sourcepub fn get_description(&self) -> &Option<String>
pub fn get_description(&self) -> &Option<String>
The description of the Amplify app.
Sourcepub fn repository(self, input: impl Into<String>) -> Self
pub fn repository(self, input: impl Into<String>) -> Self
The Git repository for the Amplify app.
Sourcepub fn set_repository(self, input: Option<String>) -> Self
pub fn set_repository(self, input: Option<String>) -> Self
The Git repository for the Amplify app.
Sourcepub fn get_repository(&self) -> &Option<String>
pub fn get_repository(&self) -> &Option<String>
The Git repository for the Amplify app.
Sourcepub fn platform(self, input: Platform) -> Self
pub fn platform(self, input: Platform) -> Self
The platform for the Amplify app. For a static app, set the platform type to WEB
. For a dynamic server-side rendered (SSR) app, set the platform type to WEB_COMPUTE
. For an app requiring Amplify Hosting's original SSR support only, set the platform type to WEB_DYNAMIC
.
If you are deploying an SSG only app with Next.js version 14 or later, you must set the platform type to WEB_COMPUTE
and set the artifacts baseDirectory
to .next
in the application's build settings. For an example of the build specification settings, see Amplify build settings for a Next.js 14 SSG application in the Amplify Hosting User Guide.
Sourcepub fn set_platform(self, input: Option<Platform>) -> Self
pub fn set_platform(self, input: Option<Platform>) -> Self
The platform for the Amplify app. For a static app, set the platform type to WEB
. For a dynamic server-side rendered (SSR) app, set the platform type to WEB_COMPUTE
. For an app requiring Amplify Hosting's original SSR support only, set the platform type to WEB_DYNAMIC
.
If you are deploying an SSG only app with Next.js version 14 or later, you must set the platform type to WEB_COMPUTE
and set the artifacts baseDirectory
to .next
in the application's build settings. For an example of the build specification settings, see Amplify build settings for a Next.js 14 SSG application in the Amplify Hosting User Guide.
Sourcepub fn get_platform(&self) -> &Option<Platform>
pub fn get_platform(&self) -> &Option<Platform>
The platform for the Amplify app. For a static app, set the platform type to WEB
. For a dynamic server-side rendered (SSR) app, set the platform type to WEB_COMPUTE
. For an app requiring Amplify Hosting's original SSR support only, set the platform type to WEB_DYNAMIC
.
If you are deploying an SSG only app with Next.js version 14 or later, you must set the platform type to WEB_COMPUTE
and set the artifacts baseDirectory
to .next
in the application's build settings. For an example of the build specification settings, see Amplify build settings for a Next.js 14 SSG application in the Amplify Hosting User Guide.
Sourcepub fn compute_role_arn(self, input: impl Into<String>) -> Self
pub fn compute_role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role to assign to an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide.
Sourcepub fn set_compute_role_arn(self, input: Option<String>) -> Self
pub fn set_compute_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role to assign to an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide.
Sourcepub fn get_compute_role_arn(&self) -> &Option<String>
pub fn get_compute_role_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the IAM role to assign to an SSR app. The SSR Compute role allows the Amplify Hosting compute service to securely access specific Amazon Web Services resources based on the role's permissions. For more information about the SSR Compute role, see Adding an SSR Compute role in the Amplify User Guide.
Sourcepub fn iam_service_role_arn(self, input: impl Into<String>) -> Self
pub fn iam_service_role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the IAM service role for the Amplify app.
Sourcepub fn set_iam_service_role_arn(self, input: Option<String>) -> Self
pub fn set_iam_service_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the IAM service role for the Amplify app.
Sourcepub fn get_iam_service_role_arn(&self) -> &Option<String>
pub fn get_iam_service_role_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the IAM service role for the Amplify app.
Sourcepub fn oauth_token(self, input: impl Into<String>) -> Self
pub fn oauth_token(self, input: impl Into<String>) -> Self
The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.
Use oauthToken
for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use accessToken
.
You must specify either oauthToken
or accessToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn set_oauth_token(self, input: Option<String>) -> Self
pub fn set_oauth_token(self, input: Option<String>) -> Self
The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.
Use oauthToken
for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use accessToken
.
You must specify either oauthToken
or accessToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn get_oauth_token(&self) -> &Option<String>
pub fn get_oauth_token(&self) -> &Option<String>
The OAuth token for a third-party source control system for an Amplify app. The OAuth token is used to create a webhook and a read-only deploy key using SSH cloning. The OAuth token is not stored.
Use oauthToken
for repository providers other than GitHub, such as Bitbucket or CodeCommit. To authorize access to GitHub as your repository provider, use accessToken
.
You must specify either oauthToken
or accessToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn access_token(self, input: impl Into<String>) -> Self
pub fn access_token(self, input: impl Into<String>) -> Self
The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.
Use accessToken
for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use oauthToken
.
You must specify either accessToken
or oauthToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn set_access_token(self, input: Option<String>) -> Self
pub fn set_access_token(self, input: Option<String>) -> Self
The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.
Use accessToken
for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use oauthToken
.
You must specify either accessToken
or oauthToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn get_access_token(&self) -> &Option<String>
pub fn get_access_token(&self) -> &Option<String>
The personal access token for a GitHub repository for an Amplify app. The personal access token is used to authorize access to a GitHub repository using the Amplify GitHub App. The token is not stored.
Use accessToken
for GitHub repositories only. To authorize access to a repository provider such as Bitbucket or CodeCommit, use oauthToken
.
You must specify either accessToken
or oauthToken
when you create a new app.
Existing Amplify apps deployed from a GitHub repository using OAuth continue to work with CI/CD. However, we strongly recommend that you migrate these apps to use the GitHub App. For more information, see Migrating an existing OAuth app to the Amplify GitHub App in the Amplify User Guide .
Sourcepub fn environment_variables(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn environment_variables( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to environmentVariables
.
To override the contents of this collection use set_environment_variables
.
The environment variables map for an Amplify app.
For a list of the environment variables that are accessible to Amplify by default, see Amplify Environment variables in the Amplify Hosting User Guide.
Sourcepub fn set_environment_variables(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_environment_variables( self, input: Option<HashMap<String, String>>, ) -> Self
The environment variables map for an Amplify app.
For a list of the environment variables that are accessible to Amplify by default, see Amplify Environment variables in the Amplify Hosting User Guide.
Sourcepub fn get_environment_variables(&self) -> &Option<HashMap<String, String>>
pub fn get_environment_variables(&self) -> &Option<HashMap<String, String>>
The environment variables map for an Amplify app.
For a list of the environment variables that are accessible to Amplify by default, see Amplify Environment variables in the Amplify Hosting User Guide.
Sourcepub fn enable_branch_auto_build(self, input: bool) -> Self
pub fn enable_branch_auto_build(self, input: bool) -> Self
Enables the auto building of branches for an Amplify app.
Sourcepub fn set_enable_branch_auto_build(self, input: Option<bool>) -> Self
pub fn set_enable_branch_auto_build(self, input: Option<bool>) -> Self
Enables the auto building of branches for an Amplify app.
Sourcepub fn get_enable_branch_auto_build(&self) -> &Option<bool>
pub fn get_enable_branch_auto_build(&self) -> &Option<bool>
Enables the auto building of branches for an Amplify app.
Sourcepub fn enable_branch_auto_deletion(self, input: bool) -> Self
pub fn enable_branch_auto_deletion(self, input: bool) -> Self
Automatically disconnects a branch in the Amplify console when you delete a branch from your Git repository.
Sourcepub fn set_enable_branch_auto_deletion(self, input: Option<bool>) -> Self
pub fn set_enable_branch_auto_deletion(self, input: Option<bool>) -> Self
Automatically disconnects a branch in the Amplify console when you delete a branch from your Git repository.
Sourcepub fn get_enable_branch_auto_deletion(&self) -> &Option<bool>
pub fn get_enable_branch_auto_deletion(&self) -> &Option<bool>
Automatically disconnects a branch in the Amplify console when you delete a branch from your Git repository.
Sourcepub fn enable_basic_auth(self, input: bool) -> Self
pub fn enable_basic_auth(self, input: bool) -> Self
Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app.
Sourcepub fn set_enable_basic_auth(self, input: Option<bool>) -> Self
pub fn set_enable_basic_auth(self, input: Option<bool>) -> Self
Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app.
Sourcepub fn get_enable_basic_auth(&self) -> &Option<bool>
pub fn get_enable_basic_auth(&self) -> &Option<bool>
Enables basic authorization for an Amplify app. This will apply to all branches that are part of this app.
Sourcepub fn basic_auth_credentials(self, input: impl Into<String>) -> Self
pub fn basic_auth_credentials(self, input: impl Into<String>) -> Self
The credentials for basic authorization for an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password
.
Sourcepub fn set_basic_auth_credentials(self, input: Option<String>) -> Self
pub fn set_basic_auth_credentials(self, input: Option<String>) -> Self
The credentials for basic authorization for an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password
.
Sourcepub fn get_basic_auth_credentials(&self) -> &Option<String>
pub fn get_basic_auth_credentials(&self) -> &Option<String>
The credentials for basic authorization for an Amplify app. You must base64-encode the authorization credentials and provide them in the format user:password
.
Sourcepub fn custom_rules(self, input: CustomRule) -> Self
pub fn custom_rules(self, input: CustomRule) -> Self
Appends an item to customRules
.
To override the contents of this collection use set_custom_rules
.
The custom rewrite and redirect rules for an Amplify app.
Sourcepub fn set_custom_rules(self, input: Option<Vec<CustomRule>>) -> Self
pub fn set_custom_rules(self, input: Option<Vec<CustomRule>>) -> Self
The custom rewrite and redirect rules for an Amplify app.
Sourcepub fn get_custom_rules(&self) -> &Option<Vec<CustomRule>>
pub fn get_custom_rules(&self) -> &Option<Vec<CustomRule>>
The custom rewrite and redirect rules for an Amplify app.
Adds a key-value pair to tags
.
To override the contents of this collection use set_tags
.
The tag for an Amplify app.
The tag for an Amplify app.
The tag for an Amplify app.
Sourcepub fn build_spec(self, input: impl Into<String>) -> Self
pub fn build_spec(self, input: impl Into<String>) -> Self
The build specification (build spec) for an Amplify app.
Sourcepub fn set_build_spec(self, input: Option<String>) -> Self
pub fn set_build_spec(self, input: Option<String>) -> Self
The build specification (build spec) for an Amplify app.
Sourcepub fn get_build_spec(&self) -> &Option<String>
pub fn get_build_spec(&self) -> &Option<String>
The build specification (build spec) for an Amplify app.
Sourcepub fn custom_headers(self, input: impl Into<String>) -> Self
pub fn custom_headers(self, input: impl Into<String>) -> Self
The custom HTTP headers for an Amplify app.
Sourcepub fn set_custom_headers(self, input: Option<String>) -> Self
pub fn set_custom_headers(self, input: Option<String>) -> Self
The custom HTTP headers for an Amplify app.
Sourcepub fn get_custom_headers(&self) -> &Option<String>
pub fn get_custom_headers(&self) -> &Option<String>
The custom HTTP headers for an Amplify app.
Sourcepub fn enable_auto_branch_creation(self, input: bool) -> Self
pub fn enable_auto_branch_creation(self, input: bool) -> Self
Enables automated branch creation for an Amplify app.
Sourcepub fn set_enable_auto_branch_creation(self, input: Option<bool>) -> Self
pub fn set_enable_auto_branch_creation(self, input: Option<bool>) -> Self
Enables automated branch creation for an Amplify app.
Sourcepub fn get_enable_auto_branch_creation(&self) -> &Option<bool>
pub fn get_enable_auto_branch_creation(&self) -> &Option<bool>
Enables automated branch creation for an Amplify app.
Sourcepub fn auto_branch_creation_patterns(self, input: impl Into<String>) -> Self
pub fn auto_branch_creation_patterns(self, input: impl Into<String>) -> Self
Appends an item to autoBranchCreationPatterns
.
To override the contents of this collection use set_auto_branch_creation_patterns
.
The automated branch creation glob patterns for an Amplify app.
Sourcepub fn set_auto_branch_creation_patterns(
self,
input: Option<Vec<String>>,
) -> Self
pub fn set_auto_branch_creation_patterns( self, input: Option<Vec<String>>, ) -> Self
The automated branch creation glob patterns for an Amplify app.
Sourcepub fn get_auto_branch_creation_patterns(&self) -> &Option<Vec<String>>
pub fn get_auto_branch_creation_patterns(&self) -> &Option<Vec<String>>
The automated branch creation glob patterns for an Amplify app.
Sourcepub fn auto_branch_creation_config(
self,
input: AutoBranchCreationConfig,
) -> Self
pub fn auto_branch_creation_config( self, input: AutoBranchCreationConfig, ) -> Self
The automated branch creation configuration for an Amplify app.
Sourcepub fn set_auto_branch_creation_config(
self,
input: Option<AutoBranchCreationConfig>,
) -> Self
pub fn set_auto_branch_creation_config( self, input: Option<AutoBranchCreationConfig>, ) -> Self
The automated branch creation configuration for an Amplify app.
Sourcepub fn get_auto_branch_creation_config(
&self,
) -> &Option<AutoBranchCreationConfig>
pub fn get_auto_branch_creation_config( &self, ) -> &Option<AutoBranchCreationConfig>
The automated branch creation configuration for an Amplify app.
Sourcepub fn job_config(self, input: JobConfig) -> Self
pub fn job_config(self, input: JobConfig) -> Self
Describes the configuration details that apply to the jobs for an Amplify app.
Sourcepub fn set_job_config(self, input: Option<JobConfig>) -> Self
pub fn set_job_config(self, input: Option<JobConfig>) -> Self
Describes the configuration details that apply to the jobs for an Amplify app.
Sourcepub fn get_job_config(&self) -> &Option<JobConfig>
pub fn get_job_config(&self) -> &Option<JobConfig>
Describes the configuration details that apply to the jobs for an Amplify app.
Sourcepub fn cache_config(self, input: CacheConfig) -> Self
pub fn cache_config(self, input: CacheConfig) -> Self
The cache configuration for the Amplify app.
Sourcepub fn set_cache_config(self, input: Option<CacheConfig>) -> Self
pub fn set_cache_config(self, input: Option<CacheConfig>) -> Self
The cache configuration for the Amplify app.
Sourcepub fn get_cache_config(&self) -> &Option<CacheConfig>
pub fn get_cache_config(&self) -> &Option<CacheConfig>
The cache configuration for the Amplify app.
Trait Implementations§
Source§impl Clone for CreateAppFluentBuilder
impl Clone for CreateAppFluentBuilder
Source§fn clone(&self) -> CreateAppFluentBuilder
fn clone(&self) -> CreateAppFluentBuilder
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 CreateAppFluentBuilder
impl !RefUnwindSafe for CreateAppFluentBuilder
impl Send for CreateAppFluentBuilder
impl Sync for CreateAppFluentBuilder
impl Unpin for CreateAppFluentBuilder
impl !UnwindSafe for CreateAppFluentBuilder
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);