pub struct Client { /* private fields */ }
Expand description
Client for AWS Backup Search
Client for invoking operations on AWS Backup Search. Each operation on AWS Backup Search 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_backupsearch::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_backupsearch::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 GetSearchJob
operation has
a Client::get_search_job
, 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.get_search_job()
.search_job_identifier("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 get_search_job(&self) -> GetSearchJobFluentBuilder
pub fn get_search_job(&self) -> GetSearchJobFluentBuilder
Constructs a fluent builder for the GetSearchJob
operation.
- The fluent builder is configurable:
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: trueRequired unique string that specifies the search job.
- On success, responds with
GetSearchJobOutput
with field(s):name(Option<String>)
:Returned name of the specified search job.
search_scope_summary(Option<SearchScopeSummary>)
:Returned summary of the specified search job scope, including:
-
TotalBackupsToScanCount, the number of recovery points returned by the search.
-
TotalItemsToScanCount, the number of items returned by the search.
-
current_search_progress(Option<CurrentSearchProgress>)
:Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.
status_message(Option<String>)
:A status message will be returned for either a earch job with a status of
ERRORED
or a status ofCOMPLETED
jobs with issues.For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.
encryption_key_arn(Option<String>)
:The encryption key for the specified search job.
Example:
arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
.completion_time(Option<DateTime>)
:The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of
CompletionTime
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.status(SearchJobState)
:The current status of the specified search job.
A search job may have one of the following statuses:
RUNNING
;COMPLETED
;STOPPED
;FAILED
;TIMED_OUT
; orEXPIRED
.search_scope(Option<SearchScope>)
:The search scope is all backup properties input into a search.
item_filters(Option<ItemFilters>)
:Item Filters represent all input item properties specified when the search was created.
creation_time(DateTime)
:The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of
CompletionTime
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.search_job_identifier(String)
:The unique string that identifies the specified search job.
search_job_arn(String)
:The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.
- On failure, responds with
SdkError<GetSearchJobError>
Source§impl Client
impl Client
Sourcepub fn get_search_result_export_job(
&self,
) -> GetSearchResultExportJobFluentBuilder
pub fn get_search_result_export_job( &self, ) -> GetSearchResultExportJobFluentBuilder
Constructs a fluent builder for the GetSearchResultExportJob
operation.
- The fluent builder is configurable:
export_job_identifier(impl Into<String>)
/set_export_job_identifier(Option<String>)
:
required: trueThis is the unique string that identifies a specific export job.
Required for this operation.
- On success, responds with
GetSearchResultExportJobOutput
with field(s):export_job_identifier(String)
:This is the unique string that identifies the specified export job.
export_job_arn(Option<String>)
:The unique Amazon Resource Name (ARN) that uniquely identifies the export job.
status(Option<ExportJobStatus>)
:This is the current status of the export job.
creation_time(Option<DateTime>)
:The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of
CreationTime
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.completion_time(Option<DateTime>)
:The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of
CreationTime
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.status_message(Option<String>)
:A status message is a string that is returned for search job with a status of
FAILED
, along with steps to remedy and retry the operation.export_specification(Option<ExportSpecification>)
:The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.
search_job_arn(Option<String>)
:The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.
- On failure, responds with
SdkError<GetSearchResultExportJobError>
Source§impl Client
impl Client
Sourcepub fn list_search_job_backups(&self) -> ListSearchJobBackupsFluentBuilder
pub fn list_search_job_backups(&self) -> ListSearchJobBackupsFluentBuilder
Constructs a fluent builder for the ListSearchJobBackups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: trueThe unique string that specifies the search job.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe next item following a partial list of returned backups included in a search job.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resource list items to be returned.
- On success, responds with
ListSearchJobBackupsOutput
with field(s):results(Vec::<SearchJobBackupsResult>)
:The recovery points returned the results of a search job
next_token(Option<String>)
:The next item following a partial list of returned backups included in a search job.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
- On failure, responds with
SdkError<ListSearchJobBackupsError>
Source§impl Client
impl Client
Sourcepub fn list_search_job_results(&self) -> ListSearchJobResultsFluentBuilder
pub fn list_search_job_results(&self) -> ListSearchJobResultsFluentBuilder
Constructs a fluent builder for the ListSearchJobResults
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: trueThe unique string that specifies the search job.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe next item following a partial list of returned search job results.
For example, if a request is made to return
MaxResults
number of search job results,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resource list items to be returned.
- On success, responds with
ListSearchJobResultsOutput
with field(s):results(Vec::<ResultItem>)
:The results consist of either EBSResultItem or S3ResultItem.
next_token(Option<String>)
:The next item following a partial list of search job results.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
- On failure, responds with
SdkError<ListSearchJobResultsError>
Source§impl Client
impl Client
Sourcepub fn list_search_jobs(&self) -> ListSearchJobsFluentBuilder
pub fn list_search_jobs(&self) -> ListSearchJobsFluentBuilder
Constructs a fluent builder for the ListSearchJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
by_status(SearchJobState)
/set_by_status(Option<SearchJobState>)
:
required: falseInclude this parameter to filter list by search job status.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe next item following a partial list of returned search jobs.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resource list items to be returned.
- On success, responds with
ListSearchJobsOutput
with field(s):search_jobs(Vec::<SearchJobSummary>)
:The search jobs among the list, with details of the returned search jobs.
next_token(Option<String>)
:The next item following a partial list of returned backups included in a search job.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
- On failure, responds with
SdkError<ListSearchJobsError>
Source§impl Client
impl Client
Sourcepub fn list_search_result_export_jobs(
&self,
) -> ListSearchResultExportJobsFluentBuilder
pub fn list_search_result_export_jobs( &self, ) -> ListSearchResultExportJobsFluentBuilder
Constructs a fluent builder for the ListSearchResultExportJobs
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
status(ExportJobStatus)
/set_status(Option<ExportJobStatus>)
:
required: falseThe search jobs to be included in the export job can be filtered by including this parameter.
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: falseThe unique string that specifies the search job.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe next item following a partial list of returned backups included in a search job.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resource list items to be returned.
- On success, responds with
ListSearchResultExportJobsOutput
with field(s):export_jobs(Vec::<ExportJobSummary>)
:The operation returns the included export jobs.
next_token(Option<String>)
:The next item following a partial list of returned backups included in a search job.
For example, if a request is made to return
MaxResults
number of backups,NextToken
allows you to return more items in your list starting at the location pointed to by the next token.
- On failure, responds with
SdkError<ListSearchResultExportJobsError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) that uniquely identifies the resource.>
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, Option<String>>>)
:List of tags returned by the operation.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn start_search_job(&self) -> StartSearchJobFluentBuilder
pub fn start_search_job(&self) -> StartSearchJobFluentBuilder
Constructs a fluent builder for the StartSearchJob
operation.
- The fluent builder is configurable:
tags(impl Into<String>, Option<String>)
/set_tags(Option<HashMap::<String, Option<String>>>)
:
required: falseList of tags returned by the operation.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseInclude alphanumeric characters to create a name for this search job.
encryption_key_arn(impl Into<String>)
/set_encryption_key_arn(Option<String>)
:
required: falseThe encryption key for the specified search job.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseInclude this parameter to allow multiple identical calls for idempotency.
A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.
search_scope(SearchScope)
/set_search_scope(Option<SearchScope>)
:
required: trueThis object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.
item_filters(ItemFilters)
/set_item_filters(Option<ItemFilters>)
:
required: falseItem Filters represent all input item properties specified when the search was created.
Contains either EBSItemFilters or S3ItemFilters
- On success, responds with
StartSearchJobOutput
with field(s):search_job_arn(Option<String>)
:The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.
creation_time(Option<DateTime>)
:The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of
CompletionTime
is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.search_job_identifier(Option<String>)
:The unique string that specifies the search job.
- On failure, responds with
SdkError<StartSearchJobError>
Source§impl Client
impl Client
Sourcepub fn start_search_result_export_job(
&self,
) -> StartSearchResultExportJobFluentBuilder
pub fn start_search_result_export_job( &self, ) -> StartSearchResultExportJobFluentBuilder
Constructs a fluent builder for the StartSearchResultExportJob
operation.
- The fluent builder is configurable:
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: trueThe unique string that specifies the search job.
export_specification(ExportSpecification)
/set_export_specification(Option<ExportSpecification>)
:
required: trueThis specification contains a required string of the destination bucket; optionally, you can include the destination prefix.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseInclude this parameter to allow multiple identical calls for idempotency.
A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.
tags(impl Into<String>, Option<String>)
/set_tags(Option<HashMap::<String, Option<String>>>)
:
required: falseOptional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: falseThis parameter specifies the role ARN used to start the search results export jobs.
- On success, responds with
StartSearchResultExportJobOutput
with field(s):export_job_arn(Option<String>)
:This is the unique ARN (Amazon Resource Name) that belongs to the new export job.
export_job_identifier(String)
:This is the unique identifier that specifies the new export job.
- On failure, responds with
SdkError<StartSearchResultExportJobError>
Source§impl Client
impl Client
Sourcepub fn stop_search_job(&self) -> StopSearchJobFluentBuilder
pub fn stop_search_job(&self) -> StopSearchJobFluentBuilder
Constructs a fluent builder for the StopSearchJob
operation.
- The fluent builder is configurable:
search_job_identifier(impl Into<String>)
/set_search_job_identifier(Option<String>)
:
required: trueThe unique string that specifies the search job.
- On success, responds with
StopSearchJobOutput
- On failure, responds with
SdkError<StopSearchJobError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) that uniquely identifies the resource.
This is the resource that will have the indicated tags.
tags(impl Into<String>, Option<String>)
/set_tags(Option<HashMap::<String, Option<String>>>)
:
required: trueRequired tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThis required parameter contains the tag keys you want to remove from the source.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
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);