pub struct Client { /* private fields */ }Expand description
Client for Amazon CloudSearch
Client for invoking operations on Amazon CloudSearch. Each operation on Amazon CloudSearch 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_cloudsearch::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_cloudsearch::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 BuildSuggesters operation has
a Client::build_suggesters, 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.build_suggesters()
.domain_name("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 build_suggesters(&self) -> BuildSuggestersFluentBuilder
pub fn build_suggesters(&self) -> BuildSuggestersFluentBuilder
Constructs a fluent builder for the BuildSuggesters operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
- On success, responds with
BuildSuggestersOutputwith field(s):field_names(Option<Vec::<String>>):A list of field names.
- On failure, responds with
SdkError<BuildSuggestersError>
Source§impl Client
impl Client
Sourcepub fn create_domain(&self) -> CreateDomainFluentBuilder
pub fn create_domain(&self) -> CreateDomainFluentBuilder
Constructs a fluent builder for the CreateDomain operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.
- On success, responds with
CreateDomainOutputwith field(s):domain_status(Option<DomainStatus>):The current status of the search domain.
- On failure, responds with
SdkError<CreateDomainError>
Source§impl Client
impl Client
Sourcepub fn define_analysis_scheme(&self) -> DefineAnalysisSchemeFluentBuilder
pub fn define_analysis_scheme(&self) -> DefineAnalysisSchemeFluentBuilder
Constructs a fluent builder for the DefineAnalysisScheme operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
analysis_scheme(AnalysisScheme)/set_analysis_scheme(Option<AnalysisScheme>):
required: trueConfiguration information for an analysis scheme. Each analysis scheme has a unique name and specifies the language of the text to be processed. The following options can be configured for an analysis scheme:
Synonyms,Stopwords,StemmingDictionary,JapaneseTokenizationDictionaryandAlgorithmicStemming.
- On success, responds with
DefineAnalysisSchemeOutputwith field(s):analysis_scheme(Option<AnalysisSchemeStatus>):The status and configuration of an
AnalysisScheme.
- On failure, responds with
SdkError<DefineAnalysisSchemeError>
Source§impl Client
impl Client
Sourcepub fn define_expression(&self) -> DefineExpressionFluentBuilder
pub fn define_expression(&self) -> DefineExpressionFluentBuilder
Constructs a fluent builder for the DefineExpression operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
expression(Expression)/set_expression(Option<Expression>):
required: trueA named expression that can be evaluated at search time. Can be used to sort the search results, define other expressions, or return computed information in the search results.
- On success, responds with
DefineExpressionOutputwith field(s):expression(Option<ExpressionStatus>):The value of an
Expressionand its current status.
- On failure, responds with
SdkError<DefineExpressionError>
Source§impl Client
impl Client
Sourcepub fn define_index_field(&self) -> DefineIndexFieldFluentBuilder
pub fn define_index_field(&self) -> DefineIndexFieldFluentBuilder
Constructs a fluent builder for the DefineIndexField operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
index_field(IndexField)/set_index_field(Option<IndexField>):
required: trueThe index field and field options you want to configure.
- On success, responds with
DefineIndexFieldOutputwith field(s):index_field(Option<IndexFieldStatus>):The value of an
IndexFieldand its current status.
- On failure, responds with
SdkError<DefineIndexFieldError>
Source§impl Client
impl Client
Sourcepub fn define_suggester(&self) -> DefineSuggesterFluentBuilder
pub fn define_suggester(&self) -> DefineSuggesterFluentBuilder
Constructs a fluent builder for the DefineSuggester operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
suggester(Suggester)/set_suggester(Option<Suggester>):
required: trueConfiguration information for a search suggester. Each suggester has a unique name and specifies the text field you want to use for suggestions. The following options can be configured for a suggester:
FuzzyMatching,SortExpression.
- On success, responds with
DefineSuggesterOutputwith field(s):suggester(Option<SuggesterStatus>):The value of a
Suggesterand its current status.
- On failure, responds with
SdkError<DefineSuggesterError>
Source§impl Client
impl Client
Sourcepub fn delete_analysis_scheme(&self) -> DeleteAnalysisSchemeFluentBuilder
pub fn delete_analysis_scheme(&self) -> DeleteAnalysisSchemeFluentBuilder
Constructs a fluent builder for the DeleteAnalysisScheme operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
analysis_scheme_name(impl Into<String>)/set_analysis_scheme_name(Option<String>):
required: trueThe name of the analysis scheme you want to delete.
- On success, responds with
DeleteAnalysisSchemeOutputwith field(s):analysis_scheme(Option<AnalysisSchemeStatus>):The status of the analysis scheme being deleted.
- On failure, responds with
SdkError<DeleteAnalysisSchemeError>
Source§impl Client
impl Client
Sourcepub fn delete_domain(&self) -> DeleteDomainFluentBuilder
pub fn delete_domain(&self) -> DeleteDomainFluentBuilder
Constructs a fluent builder for the DeleteDomain operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to permanently delete.
- On success, responds with
DeleteDomainOutputwith field(s):domain_status(Option<DomainStatus>):The current status of the search domain.
- On failure, responds with
SdkError<DeleteDomainError>
Source§impl Client
impl Client
Sourcepub fn delete_expression(&self) -> DeleteExpressionFluentBuilder
pub fn delete_expression(&self) -> DeleteExpressionFluentBuilder
Constructs a fluent builder for the DeleteExpression operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
expression_name(impl Into<String>)/set_expression_name(Option<String>):
required: trueThe name of the
to delete.Expression
- On success, responds with
DeleteExpressionOutputwith field(s):expression(Option<ExpressionStatus>):The status of the expression being deleted.
- On failure, responds with
SdkError<DeleteExpressionError>
Source§impl Client
impl Client
Sourcepub fn delete_index_field(&self) -> DeleteIndexFieldFluentBuilder
pub fn delete_index_field(&self) -> DeleteIndexFieldFluentBuilder
Constructs a fluent builder for the DeleteIndexField operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
index_field_name(impl Into<String>)/set_index_field_name(Option<String>):
required: trueThe name of the index field your want to remove from the domain’s indexing options.
- On success, responds with
DeleteIndexFieldOutputwith field(s):index_field(Option<IndexFieldStatus>):The status of the index field being deleted.
- On failure, responds with
SdkError<DeleteIndexFieldError>
Source§impl Client
impl Client
Sourcepub fn delete_suggester(&self) -> DeleteSuggesterFluentBuilder
pub fn delete_suggester(&self) -> DeleteSuggesterFluentBuilder
Constructs a fluent builder for the DeleteSuggester operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
suggester_name(impl Into<String>)/set_suggester_name(Option<String>):
required: trueSpecifies the name of the suggester you want to delete.
- On success, responds with
DeleteSuggesterOutputwith field(s):suggester(Option<SuggesterStatus>):The status of the suggester being deleted.
- On failure, responds with
SdkError<DeleteSuggesterError>
Source§impl Client
impl Client
Sourcepub fn describe_analysis_schemes(&self) -> DescribeAnalysisSchemesFluentBuilder
pub fn describe_analysis_schemes(&self) -> DescribeAnalysisSchemesFluentBuilder
Constructs a fluent builder for the DescribeAnalysisSchemes operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
analysis_scheme_names(impl Into<String>)/set_analysis_scheme_names(Option<Vec::<String>>):
required: falseThe analysis schemes you want to describe.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeAnalysisSchemesOutputwith field(s):analysis_schemes(Vec::<AnalysisSchemeStatus>):The analysis scheme descriptions.
- On failure, responds with
SdkError<DescribeAnalysisSchemesError>
Source§impl Client
impl Client
Sourcepub fn describe_availability_options(
&self,
) -> DescribeAvailabilityOptionsFluentBuilder
pub fn describe_availability_options( &self, ) -> DescribeAvailabilityOptionsFluentBuilder
Constructs a fluent builder for the DescribeAvailabilityOptions operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeAvailabilityOptionsOutputwith field(s):availability_options(Option<AvailabilityOptionsStatus>):The availability options configured for the domain. Indicates whether Multi-AZ is enabled for the domain.
- On failure, responds with
SdkError<DescribeAvailabilityOptionsError>
Source§impl Client
impl Client
Sourcepub fn describe_domain_endpoint_options(
&self,
) -> DescribeDomainEndpointOptionsFluentBuilder
pub fn describe_domain_endpoint_options( &self, ) -> DescribeDomainEndpointOptionsFluentBuilder
Constructs a fluent builder for the DescribeDomainEndpointOptions operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to retrieve the latest configuration (which might be in a Processing state) or the current, active configuration. Defaults to
false.
- On success, responds with
DescribeDomainEndpointOptionsOutputwith field(s):domain_endpoint_options(Option<DomainEndpointOptionsStatus>):The status and configuration of a search domain’s endpoint options.
- On failure, responds with
SdkError<DescribeDomainEndpointOptionsError>
Source§impl Client
impl Client
Sourcepub fn describe_domains(&self) -> DescribeDomainsFluentBuilder
pub fn describe_domains(&self) -> DescribeDomainsFluentBuilder
Constructs a fluent builder for the DescribeDomains operation.
- The fluent builder is configurable:
domain_names(impl Into<String>)/set_domain_names(Option<Vec::<String>>):
required: falseThe names of the domains you want to include in the response.
- On success, responds with
DescribeDomainsOutputwith field(s):domain_status_list(Vec::<DomainStatus>):A list that contains the status of each requested domain.
- On failure, responds with
SdkError<DescribeDomainsError>
Source§impl Client
impl Client
Sourcepub fn describe_expressions(&self) -> DescribeExpressionsFluentBuilder
pub fn describe_expressions(&self) -> DescribeExpressionsFluentBuilder
Constructs a fluent builder for the DescribeExpressions operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
expression_names(impl Into<String>)/set_expression_names(Option<Vec::<String>>):
required: falseLimits the
response to the specified expressions. If not specified, all expressions are shown.DescribeExpressionsdeployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeExpressionsOutputwith field(s):expressions(Vec::<ExpressionStatus>):The expressions configured for the domain.
- On failure, responds with
SdkError<DescribeExpressionsError>
Source§impl Client
impl Client
Sourcepub fn describe_index_fields(&self) -> DescribeIndexFieldsFluentBuilder
pub fn describe_index_fields(&self) -> DescribeIndexFieldsFluentBuilder
Constructs a fluent builder for the DescribeIndexFields operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
field_names(impl Into<String>)/set_field_names(Option<Vec::<String>>):
required: falseA list of the index fields you want to describe. If not specified, information is returned for all configured index fields.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeIndexFieldsOutputwith field(s):index_fields(Vec::<IndexFieldStatus>):The index fields configured for the domain.
- On failure, responds with
SdkError<DescribeIndexFieldsError>
Source§impl Client
impl Client
Sourcepub fn describe_scaling_parameters(
&self,
) -> DescribeScalingParametersFluentBuilder
pub fn describe_scaling_parameters( &self, ) -> DescribeScalingParametersFluentBuilder
Constructs a fluent builder for the DescribeScalingParameters operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
- On success, responds with
DescribeScalingParametersOutputwith field(s):scaling_parameters(Option<ScalingParametersStatus>):The status and configuration of a search domain’s scaling parameters.
- On failure, responds with
SdkError<DescribeScalingParametersError>
Source§impl Client
impl Client
Sourcepub fn describe_service_access_policies(
&self,
) -> DescribeServiceAccessPoliciesFluentBuilder
pub fn describe_service_access_policies( &self, ) -> DescribeServiceAccessPoliciesFluentBuilder
Constructs a fluent builder for the DescribeServiceAccessPolicies operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeServiceAccessPoliciesOutputwith field(s):access_policies(Option<AccessPoliciesStatus>):The access rules configured for the domain specified in the request.
- On failure, responds with
SdkError<DescribeServiceAccessPoliciesError>
Source§impl Client
impl Client
Sourcepub fn describe_suggesters(&self) -> DescribeSuggestersFluentBuilder
pub fn describe_suggesters(&self) -> DescribeSuggestersFluentBuilder
Constructs a fluent builder for the DescribeSuggesters operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueThe name of the domain you want to describe.
suggester_names(impl Into<String>)/set_suggester_names(Option<Vec::<String>>):
required: falseThe suggesters you want to describe.
deployed(bool)/set_deployed(Option<bool>):
required: falseWhether to display the deployed configuration (
true) or include any pending changes (false). Defaults tofalse.
- On success, responds with
DescribeSuggestersOutputwith field(s):suggesters(Vec::<SuggesterStatus>):The suggesters configured for the domain specified in the request.
- On failure, responds with
SdkError<DescribeSuggestersError>
Source§impl Client
impl Client
Sourcepub fn index_documents(&self) -> IndexDocumentsFluentBuilder
pub fn index_documents(&self) -> IndexDocumentsFluentBuilder
Constructs a fluent builder for the IndexDocuments operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
- On success, responds with
IndexDocumentsOutputwith field(s):field_names(Option<Vec::<String>>):The names of the fields that are currently being indexed.
- On failure, responds with
SdkError<IndexDocumentsError>
Source§impl Client
impl Client
Sourcepub fn list_domain_names(&self) -> ListDomainNamesFluentBuilder
pub fn list_domain_names(&self) -> ListDomainNamesFluentBuilder
Constructs a fluent builder for the ListDomainNames operation.
- The fluent builder takes no input, just
sendit. - On success, responds with
ListDomainNamesOutputwith field(s):domain_names(Option<HashMap::<String, String>>):The names of the search domains owned by an account.
- On failure, responds with
SdkError<ListDomainNamesError>
Source§impl Client
impl Client
Sourcepub fn update_availability_options(
&self,
) -> UpdateAvailabilityOptionsFluentBuilder
pub fn update_availability_options( &self, ) -> UpdateAvailabilityOptionsFluentBuilder
Constructs a fluent builder for the UpdateAvailabilityOptions operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
multi_az(bool)/set_multi_az(Option<bool>):
required: trueYou expand an existing search domain to a second Availability Zone by setting the Multi-AZ option to true. Similarly, you can turn off the Multi-AZ option to downgrade the domain to a single Availability Zone by setting the Multi-AZ option to
false.
- On success, responds with
UpdateAvailabilityOptionsOutputwith field(s):availability_options(Option<AvailabilityOptionsStatus>):The newly-configured availability options. Indicates whether Multi-AZ is enabled for the domain.
- On failure, responds with
SdkError<UpdateAvailabilityOptionsError>
Source§impl Client
impl Client
Sourcepub fn update_domain_endpoint_options(
&self,
) -> UpdateDomainEndpointOptionsFluentBuilder
pub fn update_domain_endpoint_options( &self, ) -> UpdateDomainEndpointOptionsFluentBuilder
Constructs a fluent builder for the UpdateDomainEndpointOptions operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain.
domain_endpoint_options(DomainEndpointOptions)/set_domain_endpoint_options(Option<DomainEndpointOptions>):
required: trueWhether to require that all requests to the domain arrive over HTTPS. We recommend Policy-Min-TLS-1-2-2019-07 for TLSSecurityPolicy. For compatibility with older clients, the default is Policy-Min-TLS-1-0-2019-07.
- On success, responds with
UpdateDomainEndpointOptionsOutputwith field(s):domain_endpoint_options(Option<DomainEndpointOptionsStatus>):The newly-configured domain endpoint options.
- On failure, responds with
SdkError<UpdateDomainEndpointOptionsError>
Source§impl Client
impl Client
Sourcepub fn update_scaling_parameters(&self) -> UpdateScalingParametersFluentBuilder
pub fn update_scaling_parameters(&self) -> UpdateScalingParametersFluentBuilder
Constructs a fluent builder for the UpdateScalingParameters operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
scaling_parameters(ScalingParameters)/set_scaling_parameters(Option<ScalingParameters>):
required: trueThe desired instance type and desired number of replicas of each index partition.
- On success, responds with
UpdateScalingParametersOutputwith field(s):scaling_parameters(Option<ScalingParametersStatus>):The status and configuration of a search domain’s scaling parameters.
- On failure, responds with
SdkError<UpdateScalingParametersError>
Source§impl Client
impl Client
Sourcepub fn update_service_access_policies(
&self,
) -> UpdateServiceAccessPoliciesFluentBuilder
pub fn update_service_access_policies( &self, ) -> UpdateServiceAccessPoliciesFluentBuilder
Constructs a fluent builder for the UpdateServiceAccessPolicies operation.
- The fluent builder is configurable:
domain_name(impl Into<String>)/set_domain_name(Option<String>):
required: trueA string that represents the name of a domain. Domain names are unique across the domains owned by an account within an AWS region. Domain names start with a letter or number and can contain the following characters: a-z (lowercase), 0-9, and - (hyphen).
access_policies(impl Into<String>)/set_access_policies(Option<String>):
required: trueThe access rules you want to configure. These rules replace any existing rules.
- On success, responds with
UpdateServiceAccessPoliciesOutputwith field(s):access_policies(Option<AccessPoliciesStatus>):The access rules configured for the domain.
- On failure, responds with
SdkError<UpdateServiceAccessPoliciesError>
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);