pub struct Client { /* private fields */ }Expand description
Client for AWS License Manager User Subscriptions
Client for invoking operations on AWS License Manager User Subscriptions. Each operation on AWS License Manager User Subscriptions 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_licensemanagerusersubscriptions::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_licensemanagerusersubscriptions::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 AssociateUser operation has
a Client::associate_user, 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_user()
.username("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_user(&self) -> AssociateUserFluentBuilder
pub fn associate_user(&self) -> AssociateUserFluentBuilder
Constructs a fluent builder for the AssociateUser operation.
- The fluent builder is configurable:
username(impl Into<String>)/set_username(Option<String>):
required: trueThe user name from the identity provider.
instance_id(impl Into<String>)/set_instance_id(Option<String>):
required: trueThe ID of the EC2 instance that provides the user-based subscription.
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: trueThe identity provider for the user.
domain(impl Into<String>)/set_domain(Option<String>):
required: falseThe domain name of the Active Directory that contains information for the user to associate.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseThe tags that apply for the user association.
- On success, responds with
AssociateUserOutputwith field(s):instance_user_summary(Option<InstanceUserSummary>):Metadata that describes the associate user operation.
- On failure, responds with
SdkError<AssociateUserError>
Source§impl Client
impl Client
Sourcepub fn create_license_server_endpoint(
&self,
) -> CreateLicenseServerEndpointFluentBuilder
pub fn create_license_server_endpoint( &self, ) -> CreateLicenseServerEndpointFluentBuilder
Constructs a fluent builder for the CreateLicenseServerEndpoint operation.
- The fluent builder is configurable:
identity_provider_arn(impl Into<String>)/set_identity_provider_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) that identifies the
IdentityProviderresource that contains details about a registered identity provider. In the case of Active Directory, that can be a self-managed Active Directory or an Amazon Web Services Managed Active Directory that contains user identity details.license_server_settings(LicenseServerSettings)/set_license_server_settings(Option<LicenseServerSettings>):
required: trueThe
LicenseServerSettingsresource to create for the endpoint. The settings include the type of license server and the Secrets Manager secret that enables administrators to add or remove users associated with the license server.tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseThe tags that apply for the license server endpoint.
- On success, responds with
CreateLicenseServerEndpointOutputwith field(s):identity_provider_arn(Option<String>):The Amazon Resource Name (ARN) of the identity provider specified in the request.
license_server_endpoint_arn(Option<String>):The ARN of the
LicenseServerEndpointresource.
- On failure, responds with
SdkError<CreateLicenseServerEndpointError>
Source§impl Client
impl Client
Sourcepub fn delete_license_server_endpoint(
&self,
) -> DeleteLicenseServerEndpointFluentBuilder
pub fn delete_license_server_endpoint( &self, ) -> DeleteLicenseServerEndpointFluentBuilder
Constructs a fluent builder for the DeleteLicenseServerEndpoint operation.
- The fluent builder is configurable:
license_server_endpoint_arn(impl Into<String>)/set_license_server_endpoint_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) that identifies the
LicenseServerEndpointresource to delete.server_type(ServerType)/set_server_type(Option<ServerType>):
required: trueThe type of License Server that the delete request refers to.
- On success, responds with
DeleteLicenseServerEndpointOutputwith field(s):license_server_endpoint(Option<LicenseServerEndpoint>):Shows details from the
LicenseServerEndpointresource that was deleted.
- On failure, responds with
SdkError<DeleteLicenseServerEndpointError>
Source§impl Client
impl Client
Sourcepub fn deregister_identity_provider(
&self,
) -> DeregisterIdentityProviderFluentBuilder
pub fn deregister_identity_provider( &self, ) -> DeregisterIdentityProviderFluentBuilder
Constructs a fluent builder for the DeregisterIdentityProvider operation.
- The fluent builder is configurable:
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: falseAn object that specifies details for the Active Directory identity provider.
product(impl Into<String>)/set_product(Option<String>):
required: falseThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESidentity_provider_arn(impl Into<String>)/set_identity_provider_arn(Option<String>):
required: falseThe Amazon Resource Name (ARN) that identifies the identity provider to deregister.
- On success, responds with
DeregisterIdentityProviderOutputwith field(s):identity_provider_summary(Option<IdentityProviderSummary>):Metadata that describes the results of an identity provider operation.
- On failure, responds with
SdkError<DeregisterIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn disassociate_user(&self) -> DisassociateUserFluentBuilder
pub fn disassociate_user(&self) -> DisassociateUserFluentBuilder
Constructs a fluent builder for the DisassociateUser operation.
- The fluent builder is configurable:
username(impl Into<String>)/set_username(Option<String>):
required: falseThe user name from the Active Directory identity provider for the user.
instance_id(impl Into<String>)/set_instance_id(Option<String>):
required: falseThe ID of the EC2 instance which provides user-based subscriptions.
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: falseAn object that specifies details for the Active Directory identity provider.
instance_user_arn(impl Into<String>)/set_instance_user_arn(Option<String>):
required: falseThe Amazon Resource Name (ARN) of the user to disassociate from the EC2 instance.
domain(impl Into<String>)/set_domain(Option<String>):
required: falseThe domain name of the Active Directory that contains information for the user to disassociate.
- On success, responds with
DisassociateUserOutputwith field(s):instance_user_summary(Option<InstanceUserSummary>):Metadata that describes the associate user operation.
- On failure, responds with
SdkError<DisassociateUserError>
Source§impl Client
impl Client
Sourcepub fn list_identity_providers(&self) -> ListIdentityProvidersFluentBuilder
pub fn list_identity_providers(&self) -> ListIdentityProvidersFluentBuilder
Constructs a fluent builder for the ListIdentityProviders operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return from a single request.
filters(Filter)/set_filters(Option<Vec::<Filter>>):
required: falseYou can use the following filters to streamline results:
-
Product
-
DirectoryId
-
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseA token to specify where to start paginating. This is the nextToken from a previously truncated response.
- On success, responds with
ListIdentityProvidersOutputwith field(s):identity_provider_summaries(Vec::<IdentityProviderSummary>):An array of
IdentityProviderSummaryresources that contain details about the Active Directory identity providers that meet the request criteria.next_token(Option<String>):The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.
- On failure, responds with
SdkError<ListIdentityProvidersError>
Source§impl Client
impl Client
Sourcepub fn list_instances(&self) -> ListInstancesFluentBuilder
pub fn list_instances(&self) -> ListInstancesFluentBuilder
Constructs a fluent builder for the ListInstances operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return from a single request.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseA token to specify where to start paginating. This is the nextToken from a previously truncated response.
filters(Filter)/set_filters(Option<Vec::<Filter>>):
required: falseYou can use the following filters to streamline results:
-
Status
-
InstanceId
-
- On success, responds with
ListInstancesOutputwith field(s):instance_summaries(Option<Vec::<InstanceSummary>>):An array of
InstanceSummaryresources that contain details about the instances that provide user-based subscriptions and also meet the request criteria.next_token(Option<String>):The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.
- On failure, responds with
SdkError<ListInstancesError>
Source§impl Client
impl Client
Sourcepub fn list_license_server_endpoints(
&self,
) -> ListLicenseServerEndpointsFluentBuilder
pub fn list_license_server_endpoints( &self, ) -> ListLicenseServerEndpointsFluentBuilder
Constructs a fluent builder for the ListLicenseServerEndpoints operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return from a single request.
filters(Filter)/set_filters(Option<Vec::<Filter>>):
required: falseYou can use the following filters to streamline results:
-
IdentityProviderArn
-
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseA token to specify where to start paginating. This is the nextToken from a previously truncated response.
- On success, responds with
ListLicenseServerEndpointsOutputwith field(s):license_server_endpoints(Option<Vec::<LicenseServerEndpoint>>):An array of
LicenseServerEndpointresources that contain detailed information about the RDS License Servers that meet the request criteria.next_token(Option<String>):The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.
- On failure, responds with
SdkError<ListLicenseServerEndpointsError>
Source§impl Client
impl Client
Sourcepub fn list_product_subscriptions(
&self,
) -> ListProductSubscriptionsFluentBuilder
pub fn list_product_subscriptions( &self, ) -> ListProductSubscriptionsFluentBuilder
Constructs a fluent builder for the ListProductSubscriptions operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
product(impl Into<String>)/set_product(Option<String>):
required: falseThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESidentity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: trueAn object that specifies details for the identity provider.
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return from a single request.
filters(Filter)/set_filters(Option<Vec::<Filter>>):
required: falseYou can use the following filters to streamline results:
-
Status
-
Username
-
Domain
-
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseA token to specify where to start paginating. This is the nextToken from a previously truncated response.
- On success, responds with
ListProductSubscriptionsOutputwith field(s):product_user_summaries(Option<Vec::<ProductUserSummary>>):Metadata that describes the list product subscriptions operation.
next_token(Option<String>):The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.
- On failure, responds with
SdkError<ListProductSubscriptionsError>
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 whose tags you want to retrieve.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<HashMap::<String, String>>):The tags for the specified resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn list_user_associations(&self) -> ListUserAssociationsFluentBuilder
pub fn list_user_associations(&self) -> ListUserAssociationsFluentBuilder
Constructs a fluent builder for the ListUserAssociations operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
instance_id(impl Into<String>)/set_instance_id(Option<String>):
required: trueThe ID of the EC2 instance, which provides user-based subscriptions.
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: trueAn object that specifies details for the identity provider.
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results to return from a single request.
filters(Filter)/set_filters(Option<Vec::<Filter>>):
required: falseYou can use the following filters to streamline results:
-
Status
-
Username
-
Domain
-
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseA token to specify where to start paginating. This is the nextToken from a previously truncated response.
- On success, responds with
ListUserAssociationsOutputwith field(s):instance_user_summaries(Option<Vec::<InstanceUserSummary>>):Metadata that describes the list user association operation.
next_token(Option<String>):The next token used for paginated responses. When this field isn’t empty, there are additional elements that the service hasn’t included in this request. Use this token with the next request to retrieve additional objects.
- On failure, responds with
SdkError<ListUserAssociationsError>
Source§impl Client
impl Client
Sourcepub fn register_identity_provider(
&self,
) -> RegisterIdentityProviderFluentBuilder
pub fn register_identity_provider( &self, ) -> RegisterIdentityProviderFluentBuilder
Constructs a fluent builder for the RegisterIdentityProvider operation.
- The fluent builder is configurable:
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: trueAn object that specifies details for the identity provider to register.
product(impl Into<String>)/set_product(Option<String>):
required: trueThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESsettings(Settings)/set_settings(Option<Settings>):
required: falseThe registered identity provider’s product related configuration settings such as the subnets to provision VPC endpoints.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseThe tags that apply to the identity provider’s registration.
- On success, responds with
RegisterIdentityProviderOutputwith field(s):identity_provider_summary(Option<IdentityProviderSummary>):Metadata that describes the results of an identity provider operation.
- On failure, responds with
SdkError<RegisterIdentityProviderError>
Source§impl Client
impl Client
Sourcepub fn start_product_subscription(
&self,
) -> StartProductSubscriptionFluentBuilder
pub fn start_product_subscription( &self, ) -> StartProductSubscriptionFluentBuilder
Constructs a fluent builder for the StartProductSubscription operation.
- The fluent builder is configurable:
username(impl Into<String>)/set_username(Option<String>):
required: trueThe user name from the identity provider of the user.
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: trueAn object that specifies details for the identity provider.
product(impl Into<String>)/set_product(Option<String>):
required: trueThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESdomain(impl Into<String>)/set_domain(Option<String>):
required: falseThe domain name of the Active Directory that contains the user for whom to start the product subscription.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: falseThe tags that apply to the product subscription.
- On success, responds with
StartProductSubscriptionOutputwith field(s):product_user_summary(Option<ProductUserSummary>):Metadata that describes the start product subscription operation.
- On failure, responds with
SdkError<StartProductSubscriptionError>
Source§impl Client
impl Client
Sourcepub fn stop_product_subscription(&self) -> StopProductSubscriptionFluentBuilder
pub fn stop_product_subscription(&self) -> StopProductSubscriptionFluentBuilder
Constructs a fluent builder for the StopProductSubscription operation.
- The fluent builder is configurable:
username(impl Into<String>)/set_username(Option<String>):
required: falseThe user name from the identity provider for the user.
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: falseAn object that specifies details for the identity provider.
product(impl Into<String>)/set_product(Option<String>):
required: falseThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESproduct_user_arn(impl Into<String>)/set_product_user_arn(Option<String>):
required: falseThe Amazon Resource Name (ARN) of the product user.
domain(impl Into<String>)/set_domain(Option<String>):
required: falseThe domain name of the Active Directory that contains the user for whom to stop the product subscription.
- On success, responds with
StopProductSubscriptionOutputwith field(s):product_user_summary(Option<ProductUserSummary>):Metadata that describes the start product subscription operation.
- On failure, responds with
SdkError<StopProductSubscriptionError>
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 that you want to tag.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap::<String, String>>):
required: trueThe tags to apply to the specified 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 that you want to remove tags from.
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec::<String>>):
required: trueThe tag keys to remove from the resource.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_identity_provider_settings(
&self,
) -> UpdateIdentityProviderSettingsFluentBuilder
pub fn update_identity_provider_settings( &self, ) -> UpdateIdentityProviderSettingsFluentBuilder
Constructs a fluent builder for the UpdateIdentityProviderSettings operation.
- The fluent builder is configurable:
identity_provider(IdentityProvider)/set_identity_provider(Option<IdentityProvider>):
required: falseRefers to an identity provider.
product(impl Into<String>)/set_product(Option<String>):
required: falseThe name of the user-based subscription product.
Valid values:
VISUAL_STUDIO_ENTERPRISE|VISUAL_STUDIO_PROFESSIONAL|OFFICE_PROFESSIONAL_PLUS|REMOTE_DESKTOP_SERVICESidentity_provider_arn(impl Into<String>)/set_identity_provider_arn(Option<String>):
required: falseThe Amazon Resource Name (ARN) of the identity provider to update.
update_settings(UpdateSettings)/set_update_settings(Option<UpdateSettings>):
required: trueUpdates the registered identity provider’s product related configuration settings. You can update any combination of settings in a single operation such as the:
-
Subnets which you want to add to provision VPC endpoints.
-
Subnets which you want to remove the VPC endpoints from.
-
Security group ID which permits traffic to the VPC endpoints.
-
- On success, responds with
UpdateIdentityProviderSettingsOutputwith field(s):identity_provider_summary(Option<IdentityProviderSummary>):Describes an identity provider.
- On failure, responds with
SdkError<UpdateIdentityProviderSettingsError>
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_implconfigured. - Identity caching is enabled without a
sleep_implandtime_sourceconfigured. - No
behavior_versionis 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_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it. - This method will panic if no
BehaviorVersionis provided. If you experience this panic, setbehavior_versionon the Config or enable thebehavior-version-latestCargo 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);