pub struct Client { /* private fields */ }
Expand description
Client for AWS Systems Manager for SAP
Client for invoking operations on AWS Systems Manager for SAP. Each operation on AWS Systems Manager for SAP 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_ssmsap::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_ssmsap::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 DeleteResourcePermission
operation has
a Client::delete_resource_permission
, 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.delete_resource_permission()
.action_type("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 delete_resource_permission(
&self,
) -> DeleteResourcePermissionFluentBuilder
pub fn delete_resource_permission( &self, ) -> DeleteResourcePermissionFluentBuilder
Constructs a fluent builder for the DeleteResourcePermission
operation.
- The fluent builder is configurable:
action_type(PermissionActionType)
/set_action_type(Option<PermissionActionType>)
:
required: falseDelete or restore the permissions on the target database.
source_resource_arn(impl Into<String>)
/set_source_resource_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the source resource.
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource.
- On success, responds with
DeleteResourcePermissionOutput
with field(s):policy(Option<String>)
:The policy that removes permissions on the target database.
- On failure, responds with
SdkError<DeleteResourcePermissionError>
Source§impl Client
impl Client
Sourcepub fn deregister_application(&self) -> DeregisterApplicationFluentBuilder
pub fn deregister_application(&self) -> DeregisterApplicationFluentBuilder
Constructs a fluent builder for the DeregisterApplication
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
- On success, responds with
DeregisterApplicationOutput
- On failure, responds with
SdkError<DeregisterApplicationError>
Source§impl Client
impl Client
Sourcepub fn get_application(&self) -> GetApplicationFluentBuilder
pub fn get_application(&self) -> GetApplicationFluentBuilder
Constructs a fluent builder for the GetApplication
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: falseThe ID of the application.
application_arn(impl Into<String>)
/set_application_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the application.
app_registry_arn(impl Into<String>)
/set_app_registry_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the application registry.
- On success, responds with
GetApplicationOutput
with field(s):application(Option<Application>)
:Returns all of the metadata of an application registered with AWS Systems Manager for SAP.
tags(Option<HashMap::<String, String>>)
:The tags of a registered application.
- On failure, responds with
SdkError<GetApplicationError>
Source§impl Client
impl Client
Sourcepub fn get_component(&self) -> GetComponentFluentBuilder
pub fn get_component(&self) -> GetComponentFluentBuilder
Constructs a fluent builder for the GetComponent
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
component_id(impl Into<String>)
/set_component_id(Option<String>)
:
required: trueThe ID of the component.
- On success, responds with
GetComponentOutput
with field(s):component(Option<Component>)
:The component of an application registered with AWS Systems Manager for SAP.
tags(Option<HashMap::<String, String>>)
:The tags of a component.
- On failure, responds with
SdkError<GetComponentError>
Source§impl Client
impl Client
Sourcepub fn get_database(&self) -> GetDatabaseFluentBuilder
pub fn get_database(&self) -> GetDatabaseFluentBuilder
Constructs a fluent builder for the GetDatabase
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: falseThe ID of the application.
component_id(impl Into<String>)
/set_component_id(Option<String>)
:
required: falseThe ID of the component.
database_id(impl Into<String>)
/set_database_id(Option<String>)
:
required: falseThe ID of the database.
database_arn(impl Into<String>)
/set_database_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the database.
- On success, responds with
GetDatabaseOutput
with field(s):database(Option<Database>)
:The SAP HANA database of an application registered with AWS Systems Manager for SAP.
tags(Option<HashMap::<String, String>>)
:The tags of a database.
- On failure, responds with
SdkError<GetDatabaseError>
Source§impl Client
impl Client
Sourcepub fn get_operation(&self) -> GetOperationFluentBuilder
pub fn get_operation(&self) -> GetOperationFluentBuilder
Constructs a fluent builder for the GetOperation
operation.
- The fluent builder is configurable:
operation_id(impl Into<String>)
/set_operation_id(Option<String>)
:
required: trueThe ID of the operation.
- On success, responds with
GetOperationOutput
with field(s):operation(Option<Operation>)
:Returns the details of an operation.
- On failure, responds with
SdkError<GetOperationError>
Source§impl Client
impl Client
Sourcepub fn get_resource_permission(&self) -> GetResourcePermissionFluentBuilder
pub fn get_resource_permission(&self) -> GetResourcePermissionFluentBuilder
Constructs a fluent builder for the GetResourcePermission
operation.
- The fluent builder is configurable:
action_type(PermissionActionType)
/set_action_type(Option<PermissionActionType>)
:
required: falseresource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource.
- On success, responds with
GetResourcePermissionOutput
with field(s): - On failure, responds with
SdkError<GetResourcePermissionError>
Source§impl Client
impl Client
Sourcepub fn list_applications(&self) -> ListApplicationsFluentBuilder
pub fn list_applications(&self) -> ListApplicationsFluentBuilder
Constructs a fluent builder for the ListApplications
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseThe filter of name, value, and operator.
- On success, responds with
ListApplicationsOutput
with field(s):applications(Option<Vec::<ApplicationSummary>>)
:The applications registered with AWS Systems Manager for SAP.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListApplicationsError>
Source§impl Client
impl Client
Sourcepub fn list_components(&self) -> ListComponentsFluentBuilder
pub fn list_components(&self) -> ListComponentsFluentBuilder
Constructs a fluent builder for the ListComponents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: falseThe ID of the application.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
If you do not specify a value for MaxResults, the request returns 50 items per page by default.
- On success, responds with
ListComponentsOutput
with field(s):components(Option<Vec::<ComponentSummary>>)
:List of components registered with AWS System Manager for SAP.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListComponentsError>
Source§impl Client
impl Client
Sourcepub fn list_databases(&self) -> ListDatabasesFluentBuilder
pub fn list_databases(&self) -> ListDatabasesFluentBuilder
Constructs a fluent builder for the ListDatabases
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: falseThe ID of the application.
component_id(impl Into<String>)
/set_component_id(Option<String>)
:
required: falseThe ID of the component.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. If you do not specify a value for MaxResults, the request returns 50 items per page by default.
- On success, responds with
ListDatabasesOutput
with field(s):databases(Option<Vec::<DatabaseSummary>>)
:The SAP HANA databases of an application.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListDatabasesError>
Source§impl Client
impl Client
Sourcepub fn list_operation_events(&self) -> ListOperationEventsFluentBuilder
pub fn list_operation_events(&self) -> ListOperationEventsFluentBuilder
Constructs a fluent builder for the ListOperationEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
operation_id(impl Into<String>)
/set_operation_id(Option<String>)
:
required: trueThe ID of the operation.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
If you do not specify a value for
MaxResults
, the request returns 50 items per page by default.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token to use to retrieve the next page of results. This value is null when there are no more results to return.
filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseOptionally specify filters to narrow the returned operation event items.
Valid filter names include
status
,resourceID
, andresourceType
. The valid operator for all three filters isEquals
.
- On success, responds with
ListOperationEventsOutput
with field(s):operation_events(Option<Vec::<OperationEvent>>)
:A returned list of operation events that meet the filter criteria.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListOperationEventsError>
Source§impl Client
impl Client
Sourcepub fn list_operations(&self) -> ListOperationsFluentBuilder
pub fn list_operations(&self) -> ListOperationsFluentBuilder
Constructs a fluent builder for the ListOperations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value. If you do not specify a value for MaxResults, the request returns 50 items per page by default.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next page of results.
filters(Filter)
/set_filters(Option<Vec::<Filter>>)
:
required: falseThe filters of an operation.
- On success, responds with
ListOperationsOutput
with field(s):operations(Option<Vec::<Operation>>)
:List of operations performed by AWS Systems Manager for SAP.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is null when there are no more results to return.
- On failure, responds with
SdkError<ListOperationsError>
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) of the resource.
- On success, responds with
ListTagsForResourceOutput
with field(s): - On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn put_resource_permission(&self) -> PutResourcePermissionFluentBuilder
pub fn put_resource_permission(&self) -> PutResourcePermissionFluentBuilder
Constructs a fluent builder for the PutResourcePermission
operation.
- The fluent builder is configurable:
action_type(PermissionActionType)
/set_action_type(Option<PermissionActionType>)
:
required: truesource_resource_arn(impl Into<String>)
/set_source_resource_arn(Option<String>)
:
required: trueresource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: true
- On success, responds with
PutResourcePermissionOutput
with field(s): - On failure, responds with
SdkError<PutResourcePermissionError>
Source§impl Client
impl Client
Sourcepub fn register_application(&self) -> RegisterApplicationFluentBuilder
pub fn register_application(&self) -> RegisterApplicationFluentBuilder
Constructs a fluent builder for the RegisterApplication
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
application_type(ApplicationType)
/set_application_type(Option<ApplicationType>)
:
required: trueThe type of the application.
instances(impl Into<String>)
/set_instances(Option<Vec::<String>>)
:
required: trueThe Amazon EC2 instances on which your SAP application is running.
sap_instance_number(impl Into<String>)
/set_sap_instance_number(Option<String>)
:
required: falseThe SAP instance number of the application.
sid(impl Into<String>)
/set_sid(Option<String>)
:
required: falseThe System ID of the application.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe tags to be attached to the SAP application.
credentials(ApplicationCredential)
/set_credentials(Option<Vec::<ApplicationCredential>>)
:
required: falseThe credentials of the SAP application.
database_arn(impl Into<String>)
/set_database_arn(Option<String>)
:
required: falseThe Amazon Resource Name of the SAP HANA database.
components_info(ComponentInfo)
/set_components_info(Option<Vec::<ComponentInfo>>)
:
required: falseThis is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.
This is an array of ApplicationComponent objects. You may input 0 to 5 items.
- On success, responds with
RegisterApplicationOutput
with field(s):application(Option<Application>)
:The application registered with AWS Systems Manager for SAP.
operation_id(Option<String>)
:The ID of the operation.
- On failure, responds with
SdkError<RegisterApplicationError>
Source§impl Client
impl Client
Sourcepub fn start_application(&self) -> StartApplicationFluentBuilder
pub fn start_application(&self) -> StartApplicationFluentBuilder
Constructs a fluent builder for the StartApplication
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
- On success, responds with
StartApplicationOutput
with field(s):operation_id(Option<String>)
:The ID of the operation.
- On failure, responds with
SdkError<StartApplicationError>
Source§impl Client
impl Client
Sourcepub fn start_application_refresh(&self) -> StartApplicationRefreshFluentBuilder
pub fn start_application_refresh(&self) -> StartApplicationRefreshFluentBuilder
Constructs a fluent builder for the StartApplicationRefresh
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
- On success, responds with
StartApplicationRefreshOutput
with field(s):operation_id(Option<String>)
:The ID of the operation.
- On failure, responds with
SdkError<StartApplicationRefreshError>
Source§impl Client
impl Client
Sourcepub fn stop_application(&self) -> StopApplicationFluentBuilder
pub fn stop_application(&self) -> StopApplicationFluentBuilder
Constructs a fluent builder for the StopApplication
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
stop_connected_entity(ConnectedEntityType)
/set_stop_connected_entity(Option<ConnectedEntityType>)
:
required: falseSpecify the
ConnectedEntityType
. Accepted type isDBMS
.If this parameter is included, the connected DBMS (Database Management System) will be stopped.
include_ec2_instance_shutdown(bool)
/set_include_ec2_instance_shutdown(Option<bool>)
:
required: falseBoolean. If included and if set to
True
, the StopApplication operation will shut down the associated Amazon EC2 instance in addition to the application.
- On success, responds with
StopApplicationOutput
with field(s):operation_id(Option<String>)
:The ID of the operation.
- On failure, responds with
SdkError<StopApplicationError>
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) of the resource.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueThe tags on a resource.
- 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) of the resource.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueAdds/updates or removes credentials for applications registered with AWS Systems Manager for SAP.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_application_settings(
&self,
) -> UpdateApplicationSettingsFluentBuilder
pub fn update_application_settings( &self, ) -> UpdateApplicationSettingsFluentBuilder
Constructs a fluent builder for the UpdateApplicationSettings
operation.
- The fluent builder is configurable:
application_id(impl Into<String>)
/set_application_id(Option<String>)
:
required: trueThe ID of the application.
credentials_to_add_or_update(ApplicationCredential)
/set_credentials_to_add_or_update(Option<Vec::<ApplicationCredential>>)
:
required: falseThe credentials to be added or updated.
credentials_to_remove(ApplicationCredential)
/set_credentials_to_remove(Option<Vec::<ApplicationCredential>>)
:
required: falseThe credentials to be removed.
backint(BackintConfig)
/set_backint(Option<BackintConfig>)
:
required: falseInstallation of AWS Backint Agent for SAP HANA.
database_arn(impl Into<String>)
/set_database_arn(Option<String>)
:
required: falseThe Amazon Resource Name of the SAP HANA database that replaces the current SAP HANA connection with the SAP_ABAP application.
- On success, responds with
UpdateApplicationSettingsOutput
with field(s):message(Option<String>)
:The update message.
operation_ids(Option<Vec::<String>>)
:The IDs of the operations.
- On failure, responds with
SdkError<UpdateApplicationSettingsError>
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);