pub struct Client { /* private fields */ }Expand description
Client for Migration Hub Strategy Recommendations
Client for invoking operations on Migration Hub Strategy Recommendations. Each operation on Migration Hub Strategy Recommendations 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_migrationhubstrategy::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_migrationhubstrategy::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 GetApplicationComponentDetails operation has
a Client::get_application_component_details, function which returns a builder for that operation.
The fluent builder ultimately has a send() function that returns an async future that
returns a result, as illustrated below:
let result = client.get_application_component_details()
.application_component_id("example")
.send()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn get_application_component_details(
&self,
) -> GetApplicationComponentDetailsFluentBuilder
pub fn get_application_component_details( &self, ) -> GetApplicationComponentDetailsFluentBuilder
Constructs a fluent builder for the GetApplicationComponentDetails operation.
- The fluent builder is configurable:
application_component_id(impl Into<String>)/set_application_component_id(Option<String>):
required: trueThe ID of the application component. The ID is unique within an AWS account.
- On success, responds with
GetApplicationComponentDetailsOutputwith field(s):application_component_detail(Option<ApplicationComponentDetail>):Detailed information about an application component.
associated_applications(Option<Vec::<AssociatedApplication>>):The associated application group as defined in AWS Application Discovery Service.
more_application_resource(Option<bool>):Set to true if the application component belongs to more than one application group.
associated_server_ids(Option<Vec::<String>>):A list of the IDs of the servers on which the application component is running.
- On failure, responds with
SdkError<GetApplicationComponentDetailsError>
Source§impl Client
impl Client
Sourcepub fn get_application_component_strategies(
&self,
) -> GetApplicationComponentStrategiesFluentBuilder
pub fn get_application_component_strategies( &self, ) -> GetApplicationComponentStrategiesFluentBuilder
Constructs a fluent builder for the GetApplicationComponentStrategies operation.
- The fluent builder is configurable:
application_component_id(impl Into<String>)/set_application_component_id(Option<String>):
required: trueThe ID of the application component. The ID is unique within an AWS account.
- On success, responds with
GetApplicationComponentStrategiesOutputwith field(s):application_component_strategies(Option<Vec::<ApplicationComponentStrategy>>):A list of application component strategy recommendations.
- On failure, responds with
SdkError<GetApplicationComponentStrategiesError>
Source§impl Client
impl Client
Sourcepub fn get_assessment(&self) -> GetAssessmentFluentBuilder
pub fn get_assessment(&self) -> GetAssessmentFluentBuilder
Constructs a fluent builder for the GetAssessment operation.
- The fluent builder is configurable:
id(impl Into<String>)/set_id(Option<String>):
required: trueThe
assessmentidreturned byStartAssessment.
- On success, responds with
GetAssessmentOutputwith field(s):id(Option<String>):The ID for the specific assessment task.
data_collection_details(Option<DataCollectionDetails>):Detailed information about the assessment.
assessment_targets(Option<Vec::<AssessmentTarget>>):List of criteria for assessment.
- On failure, responds with
SdkError<GetAssessmentError>
Source§impl Client
impl Client
Sourcepub fn get_import_file_task(&self) -> GetImportFileTaskFluentBuilder
pub fn get_import_file_task(&self) -> GetImportFileTaskFluentBuilder
Constructs a fluent builder for the GetImportFileTask operation.
- The fluent builder is configurable:
id(impl Into<String>)/set_id(Option<String>):
required: trueThe ID of the import file task. This ID is returned in the response of
StartImportFileTask.
- On success, responds with
GetImportFileTaskOutputwith field(s):id(Option<String>):The import file task
idreturned in the response ofStartImportFileTask.status(Option<ImportFileTaskStatus>):Status of import file task.
start_time(Option<DateTime>):Start time of the import task.
input_s3_bucket(Option<String>):The S3 bucket where import file is located.
input_s3_key(Option<String>):The Amazon S3 key name of the import file.
status_report_s3_bucket(Option<String>):The S3 bucket name for status report of import task.
status_report_s3_key(Option<String>):The Amazon S3 key name for status report of import task. The report contains details about whether each record imported successfully or why it did not.
completion_time(Option<DateTime>):The time that the import task completed.
number_of_records_success(Option<i32>):The number of records successfully imported.
number_of_records_failed(Option<i32>):The number of records that failed to be imported.
import_name(Option<String>):The name of the import task given in
StartImportFileTask.
- On failure, responds with
SdkError<GetImportFileTaskError>
Source§impl Client
impl Client
Sourcepub fn get_latest_assessment_id(&self) -> GetLatestAssessmentIdFluentBuilder
pub fn get_latest_assessment_id(&self) -> GetLatestAssessmentIdFluentBuilder
Constructs a fluent builder for the GetLatestAssessmentId operation.
- The fluent builder takes no input, just
sendit. - On success, responds with
GetLatestAssessmentIdOutputwith field(s):id(Option<String>):The latest ID for the specific assessment task.
- On failure, responds with
SdkError<GetLatestAssessmentIdError>
Source§impl Client
impl Client
Sourcepub fn get_portfolio_preferences(&self) -> GetPortfolioPreferencesFluentBuilder
pub fn get_portfolio_preferences(&self) -> GetPortfolioPreferencesFluentBuilder
Constructs a fluent builder for the GetPortfolioPreferences operation.
- The fluent builder takes no input, just
sendit. - On success, responds with
GetPortfolioPreferencesOutputwith field(s):prioritize_business_goals(Option<PrioritizeBusinessGoals>):The rank of business goals based on priority.
application_preferences(Option<ApplicationPreferences>):The transformation preferences for non-database applications.
database_preferences(Option<DatabasePreferences>):The transformation preferences for database applications.
application_mode(Option<ApplicationMode>):The classification for application component types.
- On failure, responds with
SdkError<GetPortfolioPreferencesError>
Source§impl Client
impl Client
Sourcepub fn get_portfolio_summary(&self) -> GetPortfolioSummaryFluentBuilder
pub fn get_portfolio_summary(&self) -> GetPortfolioSummaryFluentBuilder
Constructs a fluent builder for the GetPortfolioSummary operation.
- The fluent builder takes no input, just
sendit. - On success, responds with
GetPortfolioSummaryOutputwith field(s):assessment_summary(Option<AssessmentSummary>):An assessment summary for the portfolio including the number of servers to rehost and the overall number of anti-patterns.
- On failure, responds with
SdkError<GetPortfolioSummaryError>
Source§impl Client
impl Client
Sourcepub fn get_recommendation_report_details(
&self,
) -> GetRecommendationReportDetailsFluentBuilder
pub fn get_recommendation_report_details( &self, ) -> GetRecommendationReportDetailsFluentBuilder
Constructs a fluent builder for the GetRecommendationReportDetails operation.
- The fluent builder is configurable:
id(impl Into<String>)/set_id(Option<String>):
required: trueThe recommendation report generation task
idreturned byStartRecommendationReportGeneration.
- On success, responds with
GetRecommendationReportDetailsOutputwith field(s):id(Option<String>):The ID of the recommendation report generation task. See the response of
StartRecommendationReportGeneration.recommendation_report_details(Option<RecommendationReportDetails>):Detailed information about the recommendation report.
- On failure, responds with
SdkError<GetRecommendationReportDetailsError>
Source§impl Client
impl Client
Sourcepub fn get_server_details(&self) -> GetServerDetailsFluentBuilder
pub fn get_server_details(&self) -> GetServerDetailsFluentBuilder
Constructs a fluent builder for the GetServerDetails operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
server_id(impl Into<String>)/set_server_id(Option<String>):
required: trueThe ID of the server.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set
maxResultsto 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of items to include in the response. The maximum value is 100.
- On success, responds with
GetServerDetailsOutputwith field(s):next_token(Option<String>):The token you use to retrieve the next set of results, or null if there are no more results.
server_detail(Option<ServerDetail>):Detailed information about the server.
associated_applications(Option<Vec::<AssociatedApplication>>):The associated application group the server belongs to, as defined in AWS Application Discovery Service.
- On failure, responds with
SdkError<GetServerDetailsError>
Source§impl Client
impl Client
Sourcepub fn get_server_strategies(&self) -> GetServerStrategiesFluentBuilder
pub fn get_server_strategies(&self) -> GetServerStrategiesFluentBuilder
Constructs a fluent builder for the GetServerStrategies operation.
- The fluent builder is configurable:
server_id(impl Into<String>)/set_server_id(Option<String>):
required: trueThe ID of the server.
- On success, responds with
GetServerStrategiesOutputwith field(s):server_strategies(Option<Vec::<ServerStrategy>>):A list of strategy recommendations for the server.
- On failure, responds with
SdkError<GetServerStrategiesError>
Source§impl Client
impl Client
Sourcepub fn list_analyzable_servers(&self) -> ListAnalyzableServersFluentBuilder
pub fn list_analyzable_servers(&self) -> ListAnalyzableServersFluentBuilder
Constructs a fluent builder for the ListAnalyzableServers operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
sort(SortOrder)/set_sort(Option<SortOrder>):
required: false
Specifies whether to sort by ascending (ASC) or descending (DESC) order.next_token(impl Into<String>)/set_next_token(Option<String>):
required: false
The token from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set maxResults to 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: false
The maximum number of items to include in the response. The maximum value is 100.
- On success, responds with
ListAnalyzableServersOutputwith field(s):analyzable_servers(Option<Vec::<AnalyzableServerSummary>>): The list of analyzable servers with summary information about each server.next_token(Option<String>): The token you use to retrieve the next set of results, or null if there are no more results.
- On failure, responds with
SdkError<ListAnalyzableServersError>
Source§impl Client
impl Client
Sourcepub fn list_application_components(
&self,
) -> ListApplicationComponentsFluentBuilder
pub fn list_application_components( &self, ) -> ListApplicationComponentsFluentBuilder
Constructs a fluent builder for the ListApplicationComponents operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
application_component_criteria(ApplicationComponentCriteria)/set_application_component_criteria(Option<ApplicationComponentCriteria>):
required: falseCriteria for filtering the list of application components.
filter_value(impl Into<String>)/set_filter_value(Option<String>):
required: falseSpecify the value based on the application component criteria type. For example, if
applicationComponentCriteriais set toSERVER_IDandfilterValueis set toserver1, thenListApplicationComponentsreturns all the application components running on server1.sort(SortOrder)/set_sort(Option<SortOrder>):
required: falseSpecifies whether to sort by ascending (
ASC) or descending (DESC) order.group_id_filter(Group)/set_group_id_filter(Option<Vec::<Group>>):
required: falseThe group ID specified in to filter on.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set
maxResultsto 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of items to include in the response. The maximum value is 100.
- On success, responds with
ListApplicationComponentsOutputwith field(s):application_component_infos(Option<Vec::<ApplicationComponentDetail>>):The list of application components with detailed information about each component.
next_token(Option<String>):The token you use to retrieve the next set of results, or null if there are no more results.
- On failure, responds with
SdkError<ListApplicationComponentsError>
Source§impl Client
impl Client
Sourcepub fn list_collectors(&self) -> ListCollectorsFluentBuilder
pub fn list_collectors(&self) -> ListCollectorsFluentBuilder
Constructs a fluent builder for the ListCollectors 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 from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set
maxResultsto 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of items to include in the response. The maximum value is 100.
- On success, responds with
ListCollectorsOutputwith field(s):collectors(Option<Vec::<Collector>>):The list of all the installed collectors.
next_token(Option<String>):The token you use to retrieve the next set of results, or null if there are no more results.
- On failure, responds with
SdkError<ListCollectorsError>
Source§impl Client
impl Client
Sourcepub fn list_import_file_task(&self) -> ListImportFileTaskFluentBuilder
pub fn list_import_file_task(&self) -> ListImportFileTaskFluentBuilder
Constructs a fluent builder for the ListImportFileTask 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 from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set
maxResultsto 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: falseThe total number of items to return. The maximum value is 100.
- On success, responds with
ListImportFileTaskOutputwith field(s):task_infos(Option<Vec::<ImportFileTaskInformation>>):Lists information about the files you import.
next_token(Option<String>):The token you use to retrieve the next set of results, or null if there are no more results.
- On failure, responds with
SdkError<ListImportFileTaskError>
Source§impl Client
impl Client
Sourcepub fn list_servers(&self) -> ListServersFluentBuilder
pub fn list_servers(&self) -> ListServersFluentBuilder
Constructs a fluent builder for the ListServers operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
server_criteria(ServerCriteria)/set_server_criteria(Option<ServerCriteria>):
required: falseCriteria for filtering servers.
filter_value(impl Into<String>)/set_filter_value(Option<String>):
required: falseSpecifies the filter value, which is based on the type of server criteria. For example, if
serverCriteriaisOS_NAME, and thefilterValueis equal toWindowsServer, thenListServersreturns all of the servers matching the OS nameWindowsServer.sort(SortOrder)/set_sort(Option<SortOrder>):
required: falseSpecifies whether to sort by ascending (
ASC) or descending (DESC) order.group_id_filter(Group)/set_group_id_filter(Option<Vec::<Group>>):
required: falseSpecifies the group ID to filter on.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token from a previous call that you use to retrieve the next set of results. For example, if a previous call to this action returned 100 items, but you set
maxResultsto 10. You’ll receive a set of 10 results along with a token. You then use the returned token to retrieve the next set of 10.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of items to include in the response. The maximum value is 100.
- On success, responds with
ListServersOutputwith field(s):server_infos(Option<Vec::<ServerDetail>>):The list of servers with detailed information about each server.
next_token(Option<String>):The token you use to retrieve the next set of results, or null if there are no more results.
- On failure, responds with
SdkError<ListServersError>
Source§impl Client
impl Client
Sourcepub fn put_portfolio_preferences(&self) -> PutPortfolioPreferencesFluentBuilder
pub fn put_portfolio_preferences(&self) -> PutPortfolioPreferencesFluentBuilder
Constructs a fluent builder for the PutPortfolioPreferences operation.
- The fluent builder is configurable:
prioritize_business_goals(PrioritizeBusinessGoals)/set_prioritize_business_goals(Option<PrioritizeBusinessGoals>):
required: falseThe rank of the business goals based on priority.
application_preferences(ApplicationPreferences)/set_application_preferences(Option<ApplicationPreferences>):
required: falseThe transformation preferences for non-database applications.
database_preferences(DatabasePreferences)/set_database_preferences(Option<DatabasePreferences>):
required: falseThe transformation preferences for database applications.
application_mode(ApplicationMode)/set_application_mode(Option<ApplicationMode>):
required: falseThe classification for application component types.
- On success, responds with
PutPortfolioPreferencesOutput - On failure, responds with
SdkError<PutPortfolioPreferencesError>
Source§impl Client
impl Client
Sourcepub fn start_assessment(&self) -> StartAssessmentFluentBuilder
pub fn start_assessment(&self) -> StartAssessmentFluentBuilder
Constructs a fluent builder for the StartAssessment operation.
- The fluent builder is configurable:
s3bucket_for_analysis_data(impl Into<String>)/set_s3bucket_for_analysis_data(Option<String>):
required: falseThe S3 bucket used by the collectors to send analysis data to the service. The bucket name must begin with
migrationhub-strategy-.s3bucket_for_report_data(impl Into<String>)/set_s3bucket_for_report_data(Option<String>):
required: falseThe S3 bucket where all the reports generated by the service are stored. The bucket name must begin with
migrationhub-strategy-.assessment_targets(AssessmentTarget)/set_assessment_targets(Option<Vec::<AssessmentTarget>>):
required: falseList of criteria for assessment.
assessment_data_source_type(AssessmentDataSourceType)/set_assessment_data_source_type(Option<AssessmentDataSourceType>):
required: false
The data source type of an assessment to be started.
- On success, responds with
StartAssessmentOutputwith field(s):assessment_id(Option<String>):The ID of the assessment.
- On failure, responds with
SdkError<StartAssessmentError>
Source§impl Client
impl Client
Sourcepub fn start_import_file_task(&self) -> StartImportFileTaskFluentBuilder
pub fn start_import_file_task(&self) -> StartImportFileTaskFluentBuilder
Constructs a fluent builder for the StartImportFileTask operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):
required: trueA descriptive name for the request.
s3_bucket(impl Into<String>)/set_s3_bucket(Option<String>):
required: trueThe S3 bucket where the import file is located. The bucket name is required to begin with
migrationhub-strategy-.s3_key(impl Into<String>)/set_s3_key(Option<String>):
required: trueThe Amazon S3 key name of the import file.
data_source_type(DataSourceType)/set_data_source_type(Option<DataSourceType>):
required: falseSpecifies the source that the servers are coming from. By default, Strategy Recommendations assumes that the servers specified in the import file are available in AWS Application Discovery Service.
group_id(Group)/set_group_id(Option<Vec::<Group>>):
required: falseGroups the resources in the import file together with a unique name. This ID can be as filter in
ListApplicationComponentsandListServers.s3bucket_for_report_data(impl Into<String>)/set_s3bucket_for_report_data(Option<String>):
required: falseThe S3 bucket where Strategy Recommendations uploads import results. The bucket name is required to begin with migrationhub-strategy-.
- On success, responds with
StartImportFileTaskOutputwith field(s):id(Option<String>):The ID for a specific import task. The ID is unique within an AWS account.
- On failure, responds with
SdkError<StartImportFileTaskError>
Source§impl Client
impl Client
Sourcepub fn start_recommendation_report_generation(
&self,
) -> StartRecommendationReportGenerationFluentBuilder
pub fn start_recommendation_report_generation( &self, ) -> StartRecommendationReportGenerationFluentBuilder
Constructs a fluent builder for the StartRecommendationReportGeneration operation.
- The fluent builder is configurable:
output_format(OutputFormat)/set_output_format(Option<OutputFormat>):
required: falseThe output format for the recommendation report file. The default format is Microsoft Excel.
group_id_filter(Group)/set_group_id_filter(Option<Vec::<Group>>):
required: falseGroups the resources in the recommendation report with a unique name.
- On success, responds with
StartRecommendationReportGenerationOutputwith field(s):id(Option<String>):The ID of the recommendation report generation task.
- On failure, responds with
SdkError<StartRecommendationReportGenerationError>
Source§impl Client
impl Client
Sourcepub fn stop_assessment(&self) -> StopAssessmentFluentBuilder
pub fn stop_assessment(&self) -> StopAssessmentFluentBuilder
Constructs a fluent builder for the StopAssessment operation.
- The fluent builder is configurable:
assessment_id(impl Into<String>)/set_assessment_id(Option<String>):
required: trueThe
assessmentIdreturned byStartAssessment.
- On success, responds with
StopAssessmentOutput - On failure, responds with
SdkError<StopAssessmentError>
Source§impl Client
impl Client
Sourcepub fn update_application_component_config(
&self,
) -> UpdateApplicationComponentConfigFluentBuilder
pub fn update_application_component_config( &self, ) -> UpdateApplicationComponentConfigFluentBuilder
Constructs a fluent builder for the UpdateApplicationComponentConfig operation.
- The fluent builder is configurable:
application_component_id(impl Into<String>)/set_application_component_id(Option<String>):
required: trueThe ID of the application component. The ID is unique within an AWS account.
inclusion_status(InclusionStatus)/set_inclusion_status(Option<InclusionStatus>):
required: falseIndicates whether the application component has been included for server recommendation or not.
strategy_option(StrategyOption)/set_strategy_option(Option<StrategyOption>):
required: falseThe preferred strategy options for the application component. Use values from the
GetApplicationComponentStrategiesresponse.source_code_list(SourceCode)/set_source_code_list(Option<Vec::<SourceCode>>):
required: falseThe list of source code configurations to update for the application component.
secrets_manager_key(impl Into<String>)/set_secrets_manager_key(Option<String>):
required: falseDatabase credentials.
configure_only(bool)/set_configure_only(Option<bool>):
required: falseUpdate the configuration request of an application component. If it is set to true, the source code and/or database credentials are updated. If it is set to false, the source code and/or database credentials are updated and an analysis is initiated.
app_type(AppType)/set_app_type(Option<AppType>):
required: falseThe type of known component.
- On success, responds with
UpdateApplicationComponentConfigOutput - On failure, responds with
SdkError<UpdateApplicationComponentConfigError>
Source§impl Client
impl Client
Sourcepub fn update_server_config(&self) -> UpdateServerConfigFluentBuilder
pub fn update_server_config(&self) -> UpdateServerConfigFluentBuilder
Constructs a fluent builder for the UpdateServerConfig operation.
- The fluent builder is configurable:
server_id(impl Into<String>)/set_server_id(Option<String>):
required: trueThe ID of the server.
strategy_option(StrategyOption)/set_strategy_option(Option<StrategyOption>):
required: falseThe preferred strategy options for the application component. See the response from
GetServerStrategies.
- On success, responds with
UpdateServerConfigOutput - On failure, responds with
SdkError<UpdateServerConfigError>
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);