pub struct Client { /* private fields */ }
Expand description
Client for AWS CodeStar
Client for invoking operations on AWS CodeStar. Each operation on AWS CodeStar is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_codestar::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The [Builder
] struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_codestar::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the AssociateTeamMember
operation has
a Client::associate_team_member
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.associate_team_member()
.project_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn associate_team_member(&self) -> AssociateTeamMemberFluentBuilder
pub fn associate_team_member(&self) -> AssociateTeamMemberFluentBuilder
Constructs a fluent builder for the AssociateTeamMember
operation.
- The fluent builder is configurable:
project_id(impl Into<String>)
/set_project_id(Option<String>)
:
required: trueThe ID of the project to which you will add the IAM user.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA user- or system-generated token that identifies the entity that requested the team member association to the project. This token can be used to repeat the request.
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) for the IAM user you want to add to the AWS CodeStar project.
project_role(impl Into<String>)
/set_project_role(Option<String>)
:
required: trueThe AWS CodeStar project role that will apply to this user. This role determines what actions a user can take in an AWS CodeStar project.
remote_access_allowed(bool)
/set_remote_access_allowed(Option<bool>)
:
required: falseWhether the team member is allowed to use an SSH public/private key pair to remotely access project resources, for example Amazon EC2 instances.
- On success, responds with
AssociateTeamMemberOutput
with field(s):client_request_token(Option<String>)
:The user- or system-generated token from the initial request that can be used to repeat the request.
- On failure, responds with
SdkError<AssociateTeamMemberError>
Source§impl Client
impl Client
Sourcepub fn create_project(&self) -> CreateProjectFluentBuilder
pub fn create_project(&self) -> CreateProjectFluentBuilder
Constructs a fluent builder for the CreateProject
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe display name for the project to be created in AWS CodeStar.
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project to be created in AWS CodeStar.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseThe description of the project, if any.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA user- or system-generated token that identifies the entity that requested project creation. This token can be used to repeat the request.
source_code(Code)
/set_source_code(Option<Vec::<Code>>)
:
required: falseA list of the Code objects submitted with the project request. If this parameter is specified, the request must also include the toolchain parameter.
toolchain(Toolchain)
/set_toolchain(Option<Toolchain>)
:
required: falseThe name of the toolchain template file submitted with the project request. If this parameter is specified, the request must also include the sourceCode parameter.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe tags created for the project.
- On success, responds with
CreateProjectOutput
with field(s):id(String)
:The ID of the project.
arn(String)
:The Amazon Resource Name (ARN) of the created project.
client_request_token(Option<String>)
:A user- or system-generated token that identifies the entity that requested project creation.
project_template_id(Option<String>)
:Reserved for future use.
- On failure, responds with
SdkError<CreateProjectError>
Source§impl Client
impl Client
Sourcepub fn create_user_profile(&self) -> CreateUserProfileFluentBuilder
pub fn create_user_profile(&self) -> CreateUserProfileFluentBuilder
Constructs a fluent builder for the CreateUserProfile
operation.
- The fluent builder is configurable:
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user in IAM.
display_name(impl Into<String>)
/set_display_name(Option<String>)
:
required: trueThe name that will be displayed as the friendly name for the user in AWS CodeStar.
email_address(impl Into<String>)
/set_email_address(Option<String>)
:
required: trueThe email address that will be displayed as part of the user’s profile in AWS CodeStar.
ssh_public_key(impl Into<String>)
/set_ssh_public_key(Option<String>)
:
required: falseThe SSH public key associated with the user in AWS CodeStar. If a project owner allows the user remote access to project resources, this public key will be used along with the user’s private key for SSH access.
- On success, responds with
CreateUserProfileOutput
with field(s):user_arn(String)
:The Amazon Resource Name (ARN) of the user in IAM.
display_name(Option<String>)
:The name that is displayed as the friendly name for the user in AWS CodeStar.
email_address(Option<String>)
:The email address that is displayed as part of the user’s profile in AWS CodeStar.
ssh_public_key(Option<String>)
:The SSH public key associated with the user in AWS CodeStar. This is the public portion of the public/private keypair the user can use to access project resources if a project owner allows the user remote access to those resources.
created_timestamp(Option<DateTime>)
:The date the user profile was created, in timestamp format.
last_modified_timestamp(Option<DateTime>)
:The date the user profile was last modified, in timestamp format.
- On failure, responds with
SdkError<CreateUserProfileError>
Source§impl Client
impl Client
Sourcepub fn delete_project(&self) -> DeleteProjectFluentBuilder
pub fn delete_project(&self) -> DeleteProjectFluentBuilder
Constructs a fluent builder for the DeleteProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project to be deleted in AWS CodeStar.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA user- or system-generated token that identifies the entity that requested project deletion. This token can be used to repeat the request.
delete_stack(bool)
/set_delete_stack(Option<bool>)
:
required: falseWhether to send a delete request for the primary stack in AWS CloudFormation originally used to generate the project and its resources. This option will delete all AWS resources for the project (except for any buckets in Amazon S3) as well as deleting the project itself. Recommended for most use cases.
- On success, responds with
DeleteProjectOutput
with field(s):stack_id(Option<String>)
:The ID of the primary stack in AWS CloudFormation that will be deleted as part of deleting the project and its resources.
project_arn(Option<String>)
:The Amazon Resource Name (ARN) of the deleted project.
- On failure, responds with
SdkError<DeleteProjectError>
Source§impl Client
impl Client
Sourcepub fn delete_user_profile(&self) -> DeleteUserProfileFluentBuilder
pub fn delete_user_profile(&self) -> DeleteUserProfileFluentBuilder
Constructs a fluent builder for the DeleteUserProfile
operation.
- The fluent builder is configurable:
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user to delete from AWS CodeStar.
- On success, responds with
DeleteUserProfileOutput
with field(s):user_arn(String)
:The Amazon Resource Name (ARN) of the user deleted from AWS CodeStar.
- On failure, responds with
SdkError<DeleteUserProfileError>
Source§impl Client
impl Client
Sourcepub fn describe_project(&self) -> DescribeProjectFluentBuilder
pub fn describe_project(&self) -> DescribeProjectFluentBuilder
Constructs a fluent builder for the DescribeProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project.
- On success, responds with
DescribeProjectOutput
with field(s):name(Option<String>)
:The display name for the project.
id(Option<String>)
:The ID of the project.
arn(Option<String>)
:The Amazon Resource Name (ARN) for the project.
description(Option<String>)
:The description of the project, if any.
client_request_token(Option<String>)
:A user- or system-generated token that identifies the entity that requested project creation.
created_time_stamp(Option<DateTime>)
:The date and time the project was created, in timestamp format.
stack_id(Option<String>)
:The ID of the primary stack in AWS CloudFormation used to generate resources for the project.
project_template_id(Option<String>)
:The ID for the AWS CodeStar project template used to create the project.
status(Option<ProjectStatus>)
:The project creation or deletion status.
- On failure, responds with
SdkError<DescribeProjectError>
Source§impl Client
impl Client
Sourcepub fn describe_user_profile(&self) -> DescribeUserProfileFluentBuilder
pub fn describe_user_profile(&self) -> DescribeUserProfileFluentBuilder
Constructs a fluent builder for the DescribeUserProfile
operation.
- The fluent builder is configurable:
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user.
- On success, responds with
DescribeUserProfileOutput
with field(s):user_arn(String)
:The Amazon Resource Name (ARN) of the user.
display_name(Option<String>)
:The display name shown for the user in AWS CodeStar projects. For example, this could be set to both first and last name (“Mary Major”) or a single name (“Mary”). The display name is also used to generate the initial icon associated with the user in AWS CodeStar projects. If spaces are included in the display name, the first character that appears after the space will be used as the second character in the user initial icon. The initial icon displays a maximum of two characters, so a display name with more than one space (for example “Mary Jane Major”) would generate an initial icon using the first character and the first character after the space (“MJ”, not “MM”).
email_address(Option<String>)
:The email address for the user. Optional.
ssh_public_key(Option<String>)
:The SSH public key associated with the user. This SSH public key is associated with the user profile, and can be used in conjunction with the associated private key for access to project resources, such as Amazon EC2 instances, if a project owner grants remote access to those resources.
created_timestamp(DateTime)
:The date and time when the user profile was created in AWS CodeStar, in timestamp format.
last_modified_timestamp(DateTime)
:The date and time when the user profile was last modified, in timestamp format.
- On failure, responds with
SdkError<DescribeUserProfileError>
Source§impl Client
impl Client
Sourcepub fn disassociate_team_member(&self) -> DisassociateTeamMemberFluentBuilder
pub fn disassociate_team_member(&self) -> DisassociateTeamMemberFluentBuilder
Constructs a fluent builder for the DisassociateTeamMember
operation.
- The fluent builder is configurable:
project_id(impl Into<String>)
/set_project_id(Option<String>)
:
required: trueThe ID of the AWS CodeStar project from which you want to remove a team member.
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the IAM user or group whom you want to remove from the project.
- On success, responds with
DisassociateTeamMemberOutput
- On failure, responds with
SdkError<DisassociateTeamMemberError>
Source§impl Client
impl Client
Sourcepub fn list_projects(&self) -> ListProjectsFluentBuilder
pub fn list_projects(&self) -> ListProjectsFluentBuilder
Constructs a fluent builder for the ListProjects
operation.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe continuation token to be used to return the next set of results, if the results cannot be returned in one response.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum amount of data that can be contained in a single set of results.
- On success, responds with
ListProjectsOutput
with field(s):projects(Vec::<ProjectSummary>)
:A list of projects.
next_token(Option<String>)
:The continuation token to use when requesting the next set of results, if there are more results to be returned.
- On failure, responds with
SdkError<ListProjectsError>
Source§impl Client
impl Client
Sourcepub fn list_resources(&self) -> ListResourcesFluentBuilder
pub fn list_resources(&self) -> ListResourcesFluentBuilder
Constructs a fluent builder for the ListResources
operation.
- The fluent builder is configurable:
project_id(impl Into<String>)
/set_project_id(Option<String>)
:
required: trueThe ID of the project.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe continuation token for the next set of results, if the results cannot be returned in one response.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum amount of data that can be contained in a single set of results.
- On success, responds with
ListResourcesOutput
with field(s):resources(Option<Vec::<Resource>>)
:An array of resources associated with the project.
next_token(Option<String>)
:The continuation token to use when requesting the next set of results, if there are more results to be returned.
- On failure, responds with
SdkError<ListResourcesError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project to get tags for.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseReserved for future use.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseReserved for future use.
- On success, responds with
ListTagsForProjectOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The tags for the project.
next_token(Option<String>)
:Reserved for future use.
- On failure, responds with
SdkError<ListTagsForProjectError>
Source§impl Client
impl Client
Sourcepub fn list_team_members(&self) -> ListTeamMembersFluentBuilder
pub fn list_team_members(&self) -> ListTeamMembersFluentBuilder
Constructs a fluent builder for the ListTeamMembers
operation.
- The fluent builder is configurable:
project_id(impl Into<String>)
/set_project_id(Option<String>)
:
required: trueThe ID of the project for which you want to list team members.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe continuation token for the next set of results, if the results cannot be returned in one response.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of team members you want returned in a response.
- On success, responds with
ListTeamMembersOutput
with field(s):team_members(Vec::<TeamMember>)
:A list of team member objects for the project.
next_token(Option<String>)
:The continuation token to use when requesting the next set of results, if there are more results to be returned.
- On failure, responds with
SdkError<ListTeamMembersError>
Source§impl Client
impl Client
Sourcepub fn list_user_profiles(&self) -> ListUserProfilesFluentBuilder
pub fn list_user_profiles(&self) -> ListUserProfilesFluentBuilder
Constructs a fluent builder for the ListUserProfiles
operation.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe continuation token for the next set of results, if the results cannot be returned in one response.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a response.
- On success, responds with
ListUserProfilesOutput
with field(s):user_profiles(Vec::<UserProfileSummary>)
:All the user profiles configured in AWS CodeStar for an AWS account.
next_token(Option<String>)
:The continuation token to use when requesting the next set of results, if there are more results to be returned.
- On failure, responds with
SdkError<ListUserProfilesError>
Source§impl Client
impl Client
Sourcepub fn tag_project(&self) -> TagProjectFluentBuilder
pub fn tag_project(&self) -> TagProjectFluentBuilder
Constructs a fluent builder for the TagProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project you want to add a tag to.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueThe tags you want to add to the project.
- On success, responds with
TagProjectOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The tags for the project.
- On failure, responds with
SdkError<TagProjectError>
Source§impl Client
impl Client
Sourcepub fn untag_project(&self) -> UntagProjectFluentBuilder
pub fn untag_project(&self) -> UntagProjectFluentBuilder
Constructs a fluent builder for the UntagProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project to remove tags from.
tags(impl Into<String>)
/set_tags(Option<Vec::<String>>)
:
required: trueThe tags to remove from the project.
- On success, responds with
UntagProjectOutput
- On failure, responds with
SdkError<UntagProjectError>
Source§impl Client
impl Client
Sourcepub fn update_project(&self) -> UpdateProjectFluentBuilder
pub fn update_project(&self) -> UpdateProjectFluentBuilder
Constructs a fluent builder for the UpdateProject
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:
required: trueThe ID of the project you want to update.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the project you want to update.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseThe description of the project, if any.
- On success, responds with
UpdateProjectOutput
- On failure, responds with
SdkError<UpdateProjectError>
Source§impl Client
impl Client
Sourcepub fn update_team_member(&self) -> UpdateTeamMemberFluentBuilder
pub fn update_team_member(&self) -> UpdateTeamMemberFluentBuilder
Constructs a fluent builder for the UpdateTeamMember
operation.
- The fluent builder is configurable:
project_id(impl Into<String>)
/set_project_id(Option<String>)
:
required: trueThe ID of the project.
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the user for whom you want to change team membership attributes.
project_role(impl Into<String>)
/set_project_role(Option<String>)
:
required: falseThe role assigned to the user in the project. Project roles have different levels of access. For more information, see Working with Teams in the AWS CodeStar User Guide.
remote_access_allowed(bool)
/set_remote_access_allowed(Option<bool>)
:
required: falseWhether a team member is allowed to remotely access project resources using the SSH public key associated with the user’s profile. Even if this is set to True, the user must associate a public key with their profile before the user can access resources.
- On success, responds with
UpdateTeamMemberOutput
with field(s):user_arn(Option<String>)
:The Amazon Resource Name (ARN) of the user whose team membership attributes were updated.
project_role(Option<String>)
:The project role granted to the user.
remote_access_allowed(Option<bool>)
:Whether a team member is allowed to remotely access project resources using the SSH public key associated with the user’s profile.
- On failure, responds with
SdkError<UpdateTeamMemberError>
Source§impl Client
impl Client
Sourcepub fn update_user_profile(&self) -> UpdateUserProfileFluentBuilder
pub fn update_user_profile(&self) -> UpdateUserProfileFluentBuilder
Constructs a fluent builder for the UpdateUserProfile
operation.
- The fluent builder is configurable:
user_arn(impl Into<String>)
/set_user_arn(Option<String>)
:
required: trueThe name that will be displayed as the friendly name for the user in AWS CodeStar.
display_name(impl Into<String>)
/set_display_name(Option<String>)
:
required: falseThe name that is displayed as the friendly name for the user in AWS CodeStar.
email_address(impl Into<String>)
/set_email_address(Option<String>)
:
required: falseThe email address that is displayed as part of the user’s profile in AWS CodeStar.
ssh_public_key(impl Into<String>)
/set_ssh_public_key(Option<String>)
:
required: falseThe SSH public key associated with the user in AWS CodeStar. If a project owner allows the user remote access to project resources, this public key will be used along with the user’s private key for SSH access.
- On success, responds with
UpdateUserProfileOutput
with field(s):user_arn(String)
:The Amazon Resource Name (ARN) of the user in IAM.
display_name(Option<String>)
:The name that is displayed as the friendly name for the user in AWS CodeStar.
email_address(Option<String>)
:The email address that is displayed as part of the user’s profile in AWS CodeStar.
ssh_public_key(Option<String>)
:The SSH public key associated with the user in AWS CodeStar. This is the public portion of the public/private keypair the user can use to access project resources if a project owner allows the user remote access to those resources.
created_timestamp(Option<DateTime>)
:The date the user profile was created, in timestamp format.
last_modified_timestamp(Option<DateTime>)
:The date the user profile was last modified, in timestamp format.
- On failure, responds with
SdkError<UpdateUserProfileError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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);