pub struct Client { /* private fields */ }
Expand description
Client for Managed Streaming for Kafka Connect
Client for invoking operations on Managed Streaming for Kafka Connect. Each operation on Managed Streaming for Kafka Connect 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_kafkaconnect::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_kafkaconnect::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 CreateConnector
operation has
a Client::create_connector
, 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.create_connector()
.connector_description("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 create_connector(&self) -> CreateConnectorFluentBuilder
pub fn create_connector(&self) -> CreateConnectorFluentBuilder
Constructs a fluent builder for the CreateConnector
operation.
- The fluent builder is configurable:
capacity(Capacity)
/set_capacity(Option<Capacity>)
:
required: trueInformation about the capacity allocated to the connector. Exactly one of the two properties must be specified.
connector_configuration(impl Into<String>, impl Into<String>)
/set_connector_configuration(Option<HashMap::<String, String>>)
:
required: trueA map of keys to values that represent the configuration for the connector.
connector_description(impl Into<String>)
/set_connector_description(Option<String>)
:
required: falseA summary description of the connector.
connector_name(impl Into<String>)
/set_connector_name(Option<String>)
:
required: trueThe name of the connector.
kafka_cluster(KafkaCluster)
/set_kafka_cluster(Option<KafkaCluster>)
:
required: trueSpecifies which Apache Kafka cluster to connect to.
kafka_cluster_client_authentication(KafkaClusterClientAuthentication)
/set_kafka_cluster_client_authentication(Option<KafkaClusterClientAuthentication>)
:
required: trueDetails of the client authentication used by the Apache Kafka cluster.
kafka_cluster_encryption_in_transit(KafkaClusterEncryptionInTransit)
/set_kafka_cluster_encryption_in_transit(Option<KafkaClusterEncryptionInTransit>)
:
required: trueDetails of encryption in transit to the Apache Kafka cluster.
kafka_connect_version(impl Into<String>)
/set_kafka_connect_version(Option<String>)
:
required: trueThe version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster’s version and the plugins.
log_delivery(LogDelivery)
/set_log_delivery(Option<LogDelivery>)
:
required: falseDetails about log delivery.
plugins(Plugin)
/set_plugins(Option<Vec::<Plugin>>)
:
required: trueAmazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.
Specifies which plugin to use for the connector. You must specify a single-element list containing one
customPlugin
object.service_execution_role_arn(impl Into<String>)
/set_service_execution_role_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.
worker_configuration(WorkerConfiguration)
/set_worker_configuration(Option<WorkerConfiguration>)
:
required: falseSpecifies which worker configuration to use with the connector.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe tags you want to attach to the connector.
- On success, responds with
CreateConnectorOutput
with field(s):connector_arn(Option<String>)
:The Amazon Resource Name (ARN) that Amazon assigned to the connector.
connector_name(Option<String>)
:The name of the connector.
connector_state(Option<ConnectorState>)
:The state of the connector.
- On failure, responds with
SdkError<CreateConnectorError>
Source§impl Client
impl Client
Sourcepub fn create_custom_plugin(&self) -> CreateCustomPluginFluentBuilder
pub fn create_custom_plugin(&self) -> CreateCustomPluginFluentBuilder
Constructs a fluent builder for the CreateCustomPlugin
operation.
- The fluent builder is configurable:
content_type(CustomPluginContentType)
/set_content_type(Option<CustomPluginContentType>)
:
required: trueThe type of the plugin file.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA summary description of the custom plugin.
location(CustomPluginLocation)
/set_location(Option<CustomPluginLocation>)
:
required: trueInformation about the location of a custom plugin.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the custom plugin.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe tags you want to attach to the custom plugin.
- On success, responds with
CreateCustomPluginOutput
with field(s):custom_plugin_arn(Option<String>)
:The Amazon Resource Name (ARN) that Amazon assigned to the custom plugin.
custom_plugin_state(Option<CustomPluginState>)
:The state of the custom plugin.
name(Option<String>)
:The name of the custom plugin.
revision(i64)
:The revision of the custom plugin.
- On failure, responds with
SdkError<CreateCustomPluginError>
Source§impl Client
impl Client
Sourcepub fn create_worker_configuration(
&self,
) -> CreateWorkerConfigurationFluentBuilder
pub fn create_worker_configuration( &self, ) -> CreateWorkerConfigurationFluentBuilder
Constructs a fluent builder for the CreateWorkerConfiguration
operation.
- The fluent builder is configurable:
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA summary description of the worker configuration.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the worker configuration.
properties_file_content(impl Into<String>)
/set_properties_file_content(Option<String>)
:
required: trueBase64 encoded contents of connect-distributed.properties file.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe tags you want to attach to the worker configuration.
- On success, responds with
CreateWorkerConfigurationOutput
with field(s):creation_time(Option<DateTime>)
:The time that the worker configuration was created.
latest_revision(Option<WorkerConfigurationRevisionSummary>)
:The latest revision of the worker configuration.
name(Option<String>)
:The name of the worker configuration.
worker_configuration_arn(Option<String>)
:The Amazon Resource Name (ARN) that Amazon assigned to the worker configuration.
worker_configuration_state(Option<WorkerConfigurationState>)
:The state of the worker configuration.
- On failure, responds with
SdkError<CreateWorkerConfigurationError>
Source§impl Client
impl Client
Sourcepub fn delete_connector(&self) -> DeleteConnectorFluentBuilder
pub fn delete_connector(&self) -> DeleteConnectorFluentBuilder
Constructs a fluent builder for the DeleteConnector
operation.
- The fluent builder is configurable:
connector_arn(impl Into<String>)
/set_connector_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the connector that you want to delete.
current_version(impl Into<String>)
/set_current_version(Option<String>)
:
required: falseThe current version of the connector that you want to delete.
- On success, responds with
DeleteConnectorOutput
with field(s):connector_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector that you requested to delete.
connector_state(Option<ConnectorState>)
:The state of the connector that you requested to delete.
- On failure, responds with
SdkError<DeleteConnectorError>
Source§impl Client
impl Client
Sourcepub fn delete_custom_plugin(&self) -> DeleteCustomPluginFluentBuilder
pub fn delete_custom_plugin(&self) -> DeleteCustomPluginFluentBuilder
Constructs a fluent builder for the DeleteCustomPlugin
operation.
- The fluent builder is configurable:
custom_plugin_arn(impl Into<String>)
/set_custom_plugin_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the custom plugin that you want to delete.
- On success, responds with
DeleteCustomPluginOutput
with field(s):custom_plugin_arn(Option<String>)
:The Amazon Resource Name (ARN) of the custom plugin that you requested to delete.
custom_plugin_state(Option<CustomPluginState>)
:The state of the custom plugin.
- On failure, responds with
SdkError<DeleteCustomPluginError>
Source§impl Client
impl Client
Sourcepub fn delete_worker_configuration(
&self,
) -> DeleteWorkerConfigurationFluentBuilder
pub fn delete_worker_configuration( &self, ) -> DeleteWorkerConfigurationFluentBuilder
Constructs a fluent builder for the DeleteWorkerConfiguration
operation.
- The fluent builder is configurable:
worker_configuration_arn(impl Into<String>)
/set_worker_configuration_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the worker configuration that you want to delete.
- On success, responds with
DeleteWorkerConfigurationOutput
with field(s):worker_configuration_arn(Option<String>)
:The Amazon Resource Name (ARN) of the worker configuration that you requested to delete.
worker_configuration_state(Option<WorkerConfigurationState>)
:The state of the worker configuration.
- On failure, responds with
SdkError<DeleteWorkerConfigurationError>
Source§impl Client
impl Client
Sourcepub fn describe_connector(&self) -> DescribeConnectorFluentBuilder
pub fn describe_connector(&self) -> DescribeConnectorFluentBuilder
Constructs a fluent builder for the DescribeConnector
operation.
- The fluent builder is configurable:
connector_arn(impl Into<String>)
/set_connector_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the connector that you want to describe.
- On success, responds with
DescribeConnectorOutput
with field(s):capacity(Option<CapacityDescription>)
:Information about the capacity of the connector, whether it is auto scaled or provisioned.
connector_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector.
connector_configuration(Option<HashMap::<String, String>>)
:A map of keys to values that represent the configuration for the connector.
connector_description(Option<String>)
:A summary description of the connector.
connector_name(Option<String>)
:The name of the connector.
connector_state(Option<ConnectorState>)
:The state of the connector.
creation_time(Option<DateTime>)
:The time the connector was created.
current_version(Option<String>)
:The current version of the connector.
kafka_cluster(Option<KafkaClusterDescription>)
:The Apache Kafka cluster that the connector is connected to.
kafka_cluster_client_authentication(Option<KafkaClusterClientAuthenticationDescription>)
:The type of client authentication used to connect to the Apache Kafka cluster. The value is NONE when no client authentication is used.
kafka_cluster_encryption_in_transit(Option<KafkaClusterEncryptionInTransitDescription>)
:Details of encryption in transit to the Apache Kafka cluster.
kafka_connect_version(Option<String>)
:The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster’s version and the plugins.
log_delivery(Option<LogDeliveryDescription>)
:Details about delivering logs to Amazon CloudWatch Logs.
plugins(Option<Vec::<PluginDescription>>)
:Specifies which plugins were used for this connector.
service_execution_role_arn(Option<String>)
:The Amazon Resource Name (ARN) of the IAM role used by the connector to access Amazon Web Services resources.
worker_configuration(Option<WorkerConfigurationDescription>)
:Specifies which worker configuration was used for the connector.
state_description(Option<StateDescription>)
:Details about the state of a connector.
- On failure, responds with
SdkError<DescribeConnectorError>
Source§impl Client
impl Client
Sourcepub fn describe_connector_operation(
&self,
) -> DescribeConnectorOperationFluentBuilder
pub fn describe_connector_operation( &self, ) -> DescribeConnectorOperationFluentBuilder
Constructs a fluent builder for the DescribeConnectorOperation
operation.
- The fluent builder is configurable:
connector_operation_arn(impl Into<String>)
/set_connector_operation_arn(Option<String>)
:
required: trueARN of the connector operation to be described.
- On success, responds with
DescribeConnectorOperationOutput
with field(s):connector_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector.
connector_operation_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector operation.
connector_operation_state(Option<ConnectorOperationState>)
:The state of the connector operation.
connector_operation_type(Option<ConnectorOperationType>)
:The type of connector operation performed.
operation_steps(Option<Vec::<ConnectorOperationStep>>)
:The array of operation steps taken.
origin_worker_setting(Option<WorkerSetting>)
:The origin worker setting.
origin_connector_configuration(Option<HashMap::<String, String>>)
:The origin connector configuration.
target_worker_setting(Option<WorkerSetting>)
:The target worker setting.
target_connector_configuration(Option<HashMap::<String, String>>)
:The target connector configuration.
error_info(Option<StateDescription>)
:Details about the state of a resource.
creation_time(Option<DateTime>)
:The time when the operation was created.
end_time(Option<DateTime>)
:The time when the operation ended.
- On failure, responds with
SdkError<DescribeConnectorOperationError>
Source§impl Client
impl Client
Sourcepub fn describe_custom_plugin(&self) -> DescribeCustomPluginFluentBuilder
pub fn describe_custom_plugin(&self) -> DescribeCustomPluginFluentBuilder
Constructs a fluent builder for the DescribeCustomPlugin
operation.
- The fluent builder is configurable:
custom_plugin_arn(impl Into<String>)
/set_custom_plugin_arn(Option<String>)
:
required: trueReturns information about a custom plugin.
- On success, responds with
DescribeCustomPluginOutput
with field(s):creation_time(Option<DateTime>)
:The time that the custom plugin was created.
custom_plugin_arn(Option<String>)
:The Amazon Resource Name (ARN) of the custom plugin.
custom_plugin_state(Option<CustomPluginState>)
:The state of the custom plugin.
description(Option<String>)
:The description of the custom plugin.
latest_revision(Option<CustomPluginRevisionSummary>)
:The latest successfully created revision of the custom plugin. If there are no successfully created revisions, this field will be absent.
name(Option<String>)
:The name of the custom plugin.
state_description(Option<StateDescription>)
:Details about the state of a custom plugin.
- On failure, responds with
SdkError<DescribeCustomPluginError>
Source§impl Client
impl Client
Sourcepub fn describe_worker_configuration(
&self,
) -> DescribeWorkerConfigurationFluentBuilder
pub fn describe_worker_configuration( &self, ) -> DescribeWorkerConfigurationFluentBuilder
Constructs a fluent builder for the DescribeWorkerConfiguration
operation.
- The fluent builder is configurable:
worker_configuration_arn(impl Into<String>)
/set_worker_configuration_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the worker configuration that you want to get information about.
- On success, responds with
DescribeWorkerConfigurationOutput
with field(s):creation_time(Option<DateTime>)
:The time that the worker configuration was created.
description(Option<String>)
:The description of the worker configuration.
latest_revision(Option<WorkerConfigurationRevisionDescription>)
:The latest revision of the custom configuration.
name(Option<String>)
:The name of the worker configuration.
worker_configuration_arn(Option<String>)
:The Amazon Resource Name (ARN) of the custom configuration.
worker_configuration_state(Option<WorkerConfigurationState>)
:The state of the worker configuration.
- On failure, responds with
SdkError<DescribeWorkerConfigurationError>
Source§impl Client
impl Client
Sourcepub fn list_connector_operations(&self) -> ListConnectorOperationsFluentBuilder
pub fn list_connector_operations(&self) -> ListConnectorOperationsFluentBuilder
Constructs a fluent builder for the ListConnectorOperations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
connector_arn(impl Into<String>)
/set_connector_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the connector for which to list operations.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseMaximum number of connector operations to fetch in one get request.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the response is truncated, it includes a NextToken. Send this NextToken in a subsequent request to continue listing from where it left off.
- On success, responds with
ListConnectorOperationsOutput
with field(s):connector_operations(Option<Vec::<ConnectorOperationSummary>>)
:An array of connector operation descriptions.
next_token(Option<String>)
:If the response is truncated, it includes a NextToken. Send this NextToken in a subsequent request to continue listing from where it left off.
- On failure, responds with
SdkError<ListConnectorOperationsError>
Source§impl Client
impl Client
Sourcepub fn list_connectors(&self) -> ListConnectorsFluentBuilder
pub fn list_connectors(&self) -> ListConnectorsFluentBuilder
Constructs a fluent builder for the ListConnectors
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
connector_name_prefix(impl Into<String>)
/set_connector_name_prefix(Option<String>)
:
required: falseThe name prefix that you want to use to search for and list connectors.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of connectors to list in one response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the response of a ListConnectors operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where the previous operation left off.
- On success, responds with
ListConnectorsOutput
with field(s):connectors(Option<Vec::<ConnectorSummary>>)
:An array of connector descriptions.
next_token(Option<String>)
:If the response of a ListConnectors operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where it left off.
- On failure, responds with
SdkError<ListConnectorsError>
Source§impl Client
impl Client
Sourcepub fn list_custom_plugins(&self) -> ListCustomPluginsFluentBuilder
pub fn list_custom_plugins(&self) -> ListCustomPluginsFluentBuilder
Constructs a fluent builder for the ListCustomPlugins
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 custom plugins to list in one response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the response of a ListCustomPlugins operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where the previous operation left off.
name_prefix(impl Into<String>)
/set_name_prefix(Option<String>)
:
required: falseLists custom plugin names that start with the specified text string.
- On success, responds with
ListCustomPluginsOutput
with field(s):custom_plugins(Option<Vec::<CustomPluginSummary>>)
:An array of custom plugin descriptions.
next_token(Option<String>)
:If the response of a ListCustomPlugins operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where the previous operation left off.
- On failure, responds with
SdkError<ListCustomPluginsError>
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 for which you want to list all attached tags.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:Lists the tags attached to the specified resource in the corresponding request.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn list_worker_configurations(
&self,
) -> ListWorkerConfigurationsFluentBuilder
pub fn list_worker_configurations( &self, ) -> ListWorkerConfigurationsFluentBuilder
Constructs a fluent builder for the ListWorkerConfigurations
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 worker configurations to list in one response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf the response of a ListWorkerConfigurations operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where the previous operation left off.
name_prefix(impl Into<String>)
/set_name_prefix(Option<String>)
:
required: falseLists worker configuration names that start with the specified text string.
- On success, responds with
ListWorkerConfigurationsOutput
with field(s):next_token(Option<String>)
:If the response of a ListWorkerConfigurations operation is truncated, it will include a NextToken. Send this NextToken in a subsequent request to continue listing from where the previous operation left off.
worker_configurations(Option<Vec::<WorkerConfigurationSummary>>)
:An array of worker configuration descriptions.
- On failure, responds with
SdkError<ListWorkerConfigurationsError>
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 to which you want to attach tags.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueThe tags that you want to attach to the 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 from which you want to remove tags.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe keys of the tags that you want to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_connector(&self) -> UpdateConnectorFluentBuilder
pub fn update_connector(&self) -> UpdateConnectorFluentBuilder
Constructs a fluent builder for the UpdateConnector
operation.
- The fluent builder is configurable:
capacity(CapacityUpdate)
/set_capacity(Option<CapacityUpdate>)
:
required: falseThe target capacity.
connector_configuration(impl Into<String>, impl Into<String>)
/set_connector_configuration(Option<HashMap::<String, String>>)
:
required: falseA map of keys to values that represent the configuration for the connector.
connector_arn(impl Into<String>)
/set_connector_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the connector that you want to update.
current_version(impl Into<String>)
/set_current_version(Option<String>)
:
required: trueThe current version of the connector that you want to update.
- On success, responds with
UpdateConnectorOutput
with field(s):connector_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector.
connector_state(Option<ConnectorState>)
:The state of the connector.
connector_operation_arn(Option<String>)
:The Amazon Resource Name (ARN) of the connector operation.
- On failure, responds with
SdkError<UpdateConnectorError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);