pub struct Client { /* private fields */ }
Expand description
Client for AWS Data Pipeline
Client for invoking operations on AWS Data Pipeline. Each operation on AWS Data Pipeline 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_datapipeline::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_datapipeline::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 ActivatePipeline
operation has
a Client::activate_pipeline
, 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.activate_pipeline()
.pipeline_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 activate_pipeline(&self) -> ActivatePipelineFluentBuilder
pub fn activate_pipeline(&self) -> ActivatePipelineFluentBuilder
Constructs a fluent builder for the ActivatePipeline
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
parameter_values(ParameterValue)
/set_parameter_values(Option<Vec::<ParameterValue>>)
:
required: falseA list of parameter values to pass to the pipeline at activation.
start_timestamp(DateTime)
/set_start_timestamp(Option<DateTime>)
:
required: falseThe date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.
- On success, responds with
ActivatePipelineOutput
- On failure, responds with
SdkError<ActivatePipelineError>
Source§impl Client
impl Client
Constructs a fluent builder for the AddTags
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueThe tags to add, as key/value pairs.
- On success, responds with
AddTagsOutput
- On failure, responds with
SdkError<AddTagsError>
Source§impl Client
impl Client
Sourcepub fn create_pipeline(&self) -> CreatePipelineFluentBuilder
pub fn create_pipeline(&self) -> CreatePipelineFluentBuilder
Constructs a fluent builder for the CreatePipeline
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name for the pipeline. You can use the same name for multiple pipelines associated with your AWS account, because AWS Data Pipeline assigns each pipeline a unique pipeline identifier.
unique_id(impl Into<String>)
/set_unique_id(Option<String>)
:
required: trueA unique identifier. This identifier is not the same as the pipeline identifier assigned by AWS Data Pipeline. You are responsible for defining the format and ensuring the uniqueness of this identifier. You use this parameter to ensure idempotency during repeated calls to
CreatePipeline
. For example, if the first call toCreatePipeline
does not succeed, you can pass in the same unique identifier and pipeline name combination on a subsequent call toCreatePipeline
.CreatePipeline
ensures that if a pipeline already exists with the same name and unique identifier, a new pipeline is not created. Instead, you’ll receive the pipeline identifier from the previous attempt. The uniqueness of the name and unique identifier combination is scoped to the AWS account or IAM user credentials.description(impl Into<String>)
/set_description(Option<String>)
:
required: falseThe description for the pipeline.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA list of tags to associate with the pipeline at creation. Tags let you control access to pipelines. For more information, see Controlling User Access to Pipelines in the AWS Data Pipeline Developer Guide.
- On success, responds with
CreatePipelineOutput
with field(s):pipeline_id(String)
:The ID that AWS Data Pipeline assigns the newly created pipeline. For example,
df-06372391ZG65EXAMPLE
.
- On failure, responds with
SdkError<CreatePipelineError>
Source§impl Client
impl Client
Sourcepub fn deactivate_pipeline(&self) -> DeactivatePipelineFluentBuilder
pub fn deactivate_pipeline(&self) -> DeactivatePipelineFluentBuilder
Constructs a fluent builder for the DeactivatePipeline
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
cancel_active(bool)
/set_cancel_active(Option<bool>)
:
required: falseIndicates whether to cancel any running objects. The default is true, which sets the state of any running objects to
CANCELED
. If this value is false, the pipeline is deactivated after all running objects finish.
- On success, responds with
DeactivatePipelineOutput
- On failure, responds with
SdkError<DeactivatePipelineError>
Source§impl Client
impl Client
Sourcepub fn delete_pipeline(&self) -> DeletePipelineFluentBuilder
pub fn delete_pipeline(&self) -> DeletePipelineFluentBuilder
Constructs a fluent builder for the DeletePipeline
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
- On success, responds with
DeletePipelineOutput
- On failure, responds with
SdkError<DeletePipelineError>
Source§impl Client
impl Client
Sourcepub fn describe_objects(&self) -> DescribeObjectsFluentBuilder
pub fn describe_objects(&self) -> DescribeObjectsFluentBuilder
Constructs a fluent builder for the DescribeObjects
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline that contains the object definitions.
object_ids(impl Into<String>)
/set_object_ids(Option<Vec::<String>>)
:
required: trueThe IDs of the pipeline objects that contain the definitions to be described. You can pass as many as 25 identifiers in a single call to
DescribeObjects
.evaluate_expressions(bool)
/set_evaluate_expressions(Option<bool>)
:
required: falseIndicates whether any expressions in the object should be evaluated when the object descriptions are returned.
marker(impl Into<String>)
/set_marker(Option<String>)
:
required: falseThe starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call
DescribeObjects
with the marker value from the previous call to retrieve the next set of results.
- On success, responds with
DescribeObjectsOutput
with field(s):pipeline_objects(Vec::<PipelineObject>)
:An array of object definitions.
marker(Option<String>)
:The starting point for the next page of results. To view the next page of results, call
DescribeObjects
again with this marker value. If the value is null, there are no more results.has_more_results(bool)
:Indicates whether there are more results to return.
- On failure, responds with
SdkError<DescribeObjectsError>
Source§impl Client
impl Client
Sourcepub fn describe_pipelines(&self) -> DescribePipelinesFluentBuilder
pub fn describe_pipelines(&self) -> DescribePipelinesFluentBuilder
Constructs a fluent builder for the DescribePipelines
operation.
- The fluent builder is configurable:
pipeline_ids(impl Into<String>)
/set_pipeline_ids(Option<Vec::<String>>)
:
required: trueThe IDs of the pipelines to describe. You can pass as many as 25 identifiers in a single call. To obtain pipeline IDs, call
ListPipelines
.
- On success, responds with
DescribePipelinesOutput
with field(s):pipeline_description_list(Vec::<PipelineDescription>)
:An array of descriptions for the specified pipelines.
- On failure, responds with
SdkError<DescribePipelinesError>
Source§impl Client
impl Client
Sourcepub fn evaluate_expression(&self) -> EvaluateExpressionFluentBuilder
pub fn evaluate_expression(&self) -> EvaluateExpressionFluentBuilder
Constructs a fluent builder for the EvaluateExpression
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
object_id(impl Into<String>)
/set_object_id(Option<String>)
:
required: trueThe ID of the object.
expression(impl Into<String>)
/set_expression(Option<String>)
:
required: trueThe expression to evaluate.
- On success, responds with
EvaluateExpressionOutput
with field(s):evaluated_expression(String)
:The evaluated expression.
- On failure, responds with
SdkError<EvaluateExpressionError>
Source§impl Client
impl Client
Sourcepub fn get_pipeline_definition(&self) -> GetPipelineDefinitionFluentBuilder
pub fn get_pipeline_definition(&self) -> GetPipelineDefinitionFluentBuilder
Constructs a fluent builder for the GetPipelineDefinition
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
version(impl Into<String>)
/set_version(Option<String>)
:
required: falseThe version of the pipeline definition to retrieve. Set this parameter to
latest
(default) to use the last definition saved to the pipeline oractive
to use the last definition that was activated.
- On success, responds with
GetPipelineDefinitionOutput
with field(s):pipeline_objects(Option<Vec::<PipelineObject>>)
:The objects defined in the pipeline.
parameter_objects(Option<Vec::<ParameterObject>>)
:The parameter objects used in the pipeline definition.
parameter_values(Option<Vec::<ParameterValue>>)
:The parameter values used in the pipeline definition.
- On failure, responds with
SdkError<GetPipelineDefinitionError>
Source§impl Client
impl Client
Sourcepub fn list_pipelines(&self) -> ListPipelinesFluentBuilder
pub fn list_pipelines(&self) -> ListPipelinesFluentBuilder
Constructs a fluent builder for the ListPipelines
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
marker(impl Into<String>)
/set_marker(Option<String>)
:
required: falseThe starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call
ListPipelines
with the marker value from the previous call to retrieve the next set of results.
- On success, responds with
ListPipelinesOutput
with field(s):pipeline_id_list(Vec::<PipelineIdName>)
:The pipeline identifiers. If you require additional information about the pipelines, you can use these identifiers to call
DescribePipelines
andGetPipelineDefinition
.marker(Option<String>)
:The starting point for the next page of results. To view the next page of results, call
ListPipelinesOutput
again with this marker value. If the value is null, there are no more results.has_more_results(bool)
:Indicates whether there are more results that can be obtained by a subsequent call.
- On failure, responds with
SdkError<ListPipelinesError>
Source§impl Client
impl Client
Sourcepub fn poll_for_task(&self) -> PollForTaskFluentBuilder
pub fn poll_for_task(&self) -> PollForTaskFluentBuilder
Constructs a fluent builder for the PollForTask
operation.
- The fluent builder is configurable:
worker_group(impl Into<String>)
/set_worker_group(Option<String>)
:
required: trueThe type of task the task runner is configured to accept and process. The worker group is set as a field on objects in the pipeline when they are created. You can only specify a single value for
workerGroup
in the call toPollForTask
. There are no wildcard values permitted inworkerGroup
; the string must be an exact, case-sensitive, match.hostname(impl Into<String>)
/set_hostname(Option<String>)
:
required: falseThe public DNS name of the calling task runner.
instance_identity(InstanceIdentity)
/set_instance_identity(Option<InstanceIdentity>)
:
required: falseIdentity information for the EC2 instance that is hosting the task runner. You can get this value from the instance using
http://169.254.169.254/latest/meta-data/instance-id
. For more information, see Instance Metadata in the Amazon Elastic Compute Cloud User Guide. Passing in this value proves that your task runner is running on an EC2 instance, and ensures the proper AWS Data Pipeline service charges are applied to your pipeline.
- On success, responds with
PollForTaskOutput
with field(s):task_object(Option<TaskObject>)
:The information needed to complete the task that is being assigned to the task runner. One of the fields returned in this object is
taskId
, which contains an identifier for the task being assigned. The calling task runner usestaskId
in subsequent calls toReportTaskProgress
andSetTaskStatus
.
- On failure, responds with
SdkError<PollForTaskError>
Source§impl Client
impl Client
Sourcepub fn put_pipeline_definition(&self) -> PutPipelineDefinitionFluentBuilder
pub fn put_pipeline_definition(&self) -> PutPipelineDefinitionFluentBuilder
Constructs a fluent builder for the PutPipelineDefinition
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
pipeline_objects(PipelineObject)
/set_pipeline_objects(Option<Vec::<PipelineObject>>)
:
required: trueThe objects that define the pipeline. These objects overwrite the existing pipeline definition.
parameter_objects(ParameterObject)
/set_parameter_objects(Option<Vec::<ParameterObject>>)
:
required: falseThe parameter objects used with the pipeline.
parameter_values(ParameterValue)
/set_parameter_values(Option<Vec::<ParameterValue>>)
:
required: falseThe parameter values used with the pipeline.
- On success, responds with
PutPipelineDefinitionOutput
with field(s):validation_errors(Option<Vec::<ValidationError>>)
:The validation errors that are associated with the objects defined in
pipelineObjects
.validation_warnings(Option<Vec::<ValidationWarning>>)
:The validation warnings that are associated with the objects defined in
pipelineObjects
.errored(bool)
:Indicates whether there were validation errors, and the pipeline definition is stored but cannot be activated until you correct the pipeline and call
PutPipelineDefinition
to commit the corrected pipeline.
- On failure, responds with
SdkError<PutPipelineDefinitionError>
Source§impl Client
impl Client
Sourcepub fn query_objects(&self) -> QueryObjectsFluentBuilder
pub fn query_objects(&self) -> QueryObjectsFluentBuilder
Constructs a fluent builder for the QueryObjects
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
query(Query)
/set_query(Option<Query>)
:
required: falseThe query that defines the objects to be returned. The
Query
object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts.sphere(impl Into<String>)
/set_sphere(Option<String>)
:
required: trueIndicates whether the query applies to components or instances. The possible values are:
COMPONENT
,INSTANCE
, andATTEMPT
.marker(impl Into<String>)
/set_marker(Option<String>)
:
required: falseThe starting point for the results to be returned. For the first call, this value should be empty. As long as there are more results, continue to call
QueryObjects
with the marker value from the previous call to retrieve the next set of results.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of object names that
QueryObjects
will return in a single call. The default value is 100.
- On success, responds with
QueryObjectsOutput
with field(s):ids(Option<Vec::<String>>)
:The identifiers that match the query selectors.
marker(Option<String>)
:The starting point for the next page of results. To view the next page of results, call
QueryObjects
again with this marker value. If the value is null, there are no more results.has_more_results(bool)
:Indicates whether there are more results that can be obtained by a subsequent call.
- On failure, responds with
SdkError<QueryObjectsError>
Source§impl Client
impl Client
Constructs a fluent builder for the RemoveTags
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe keys of the tags to remove.
- On success, responds with
RemoveTagsOutput
- On failure, responds with
SdkError<RemoveTagsError>
Source§impl Client
impl Client
Sourcepub fn report_task_progress(&self) -> ReportTaskProgressFluentBuilder
pub fn report_task_progress(&self) -> ReportTaskProgressFluentBuilder
Constructs a fluent builder for the ReportTaskProgress
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task assigned to the task runner. This value is provided in the response for
PollForTask
.fields(Field)
/set_fields(Option<Vec::<Field>>)
:
required: falseKey-value pairs that define the properties of the ReportTaskProgressInput object.
- On success, responds with
ReportTaskProgressOutput
with field(s):canceled(bool)
:If true, the calling task runner should cancel processing of the task. The task runner does not need to call
SetTaskStatus
for canceled tasks.
- On failure, responds with
SdkError<ReportTaskProgressError>
Source§impl Client
impl Client
Sourcepub fn report_task_runner_heartbeat(
&self,
) -> ReportTaskRunnerHeartbeatFluentBuilder
pub fn report_task_runner_heartbeat( &self, ) -> ReportTaskRunnerHeartbeatFluentBuilder
Constructs a fluent builder for the ReportTaskRunnerHeartbeat
operation.
- The fluent builder is configurable:
taskrunner_id(impl Into<String>)
/set_taskrunner_id(Option<String>)
:
required: trueThe ID of the task runner. This value should be unique across your AWS account. In the case of AWS Data Pipeline Task Runner launched on a resource managed by AWS Data Pipeline, the web service provides a unique identifier when it launches the application. If you have written a custom task runner, you should assign a unique identifier for the task runner.
worker_group(impl Into<String>)
/set_worker_group(Option<String>)
:
required: falseThe type of task the task runner is configured to accept and process. The worker group is set as a field on objects in the pipeline when they are created. You can only specify a single value for
workerGroup
. There are no wildcard values permitted inworkerGroup
; the string must be an exact, case-sensitive, match.hostname(impl Into<String>)
/set_hostname(Option<String>)
:
required: falseThe public DNS name of the task runner.
- On success, responds with
ReportTaskRunnerHeartbeatOutput
with field(s):terminate(bool)
:Indicates whether the calling task runner should terminate.
- On failure, responds with
SdkError<ReportTaskRunnerHeartbeatError>
Source§impl Client
impl Client
Sourcepub fn set_status(&self) -> SetStatusFluentBuilder
pub fn set_status(&self) -> SetStatusFluentBuilder
Constructs a fluent builder for the SetStatus
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline that contains the objects.
object_ids(impl Into<String>)
/set_object_ids(Option<Vec::<String>>)
:
required: trueThe IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.
status(impl Into<String>)
/set_status(Option<String>)
:
required: trueThe status to be set on all the objects specified in
objectIds
. For components, usePAUSE
orRESUME
. For instances, useTRY_CANCEL
,RERUN
, orMARK_FINISHED
.
- On success, responds with
SetStatusOutput
- On failure, responds with
SdkError<SetStatusError>
Source§impl Client
impl Client
Sourcepub fn set_task_status(&self) -> SetTaskStatusFluentBuilder
pub fn set_task_status(&self) -> SetTaskStatusFluentBuilder
Constructs a fluent builder for the SetTaskStatus
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task assigned to the task runner. This value is provided in the response for
PollForTask
.task_status(TaskStatus)
/set_task_status(Option<TaskStatus>)
:
required: trueIf
FINISHED
, the task successfully completed. IfFAILED
, the task ended unsuccessfully. Preconditions use false.error_id(impl Into<String>)
/set_error_id(Option<String>)
:
required: falseIf an error occurred during the task, this value specifies the error code. This value is set on the physical attempt object. It is used to display error information to the user. It should not start with string “Service_” which is reserved by the system.
error_message(impl Into<String>)
/set_error_message(Option<String>)
:
required: falseIf an error occurred during the task, this value specifies a text description of the error. This value is set on the physical attempt object. It is used to display error information to the user. The web service does not parse this value.
error_stack_trace(impl Into<String>)
/set_error_stack_trace(Option<String>)
:
required: falseIf an error occurred during the task, this value specifies the stack trace associated with the error. This value is set on the physical attempt object. It is used to display error information to the user. The web service does not parse this value.
- On success, responds with
SetTaskStatusOutput
- On failure, responds with
SdkError<SetTaskStatusError>
Source§impl Client
impl Client
Sourcepub fn validate_pipeline_definition(
&self,
) -> ValidatePipelineDefinitionFluentBuilder
pub fn validate_pipeline_definition( &self, ) -> ValidatePipelineDefinitionFluentBuilder
Constructs a fluent builder for the ValidatePipelineDefinition
operation.
- The fluent builder is configurable:
pipeline_id(impl Into<String>)
/set_pipeline_id(Option<String>)
:
required: trueThe ID of the pipeline.
pipeline_objects(PipelineObject)
/set_pipeline_objects(Option<Vec::<PipelineObject>>)
:
required: trueThe objects that define the pipeline changes to validate against the pipeline.
parameter_objects(ParameterObject)
/set_parameter_objects(Option<Vec::<ParameterObject>>)
:
required: falseThe parameter objects used with the pipeline.
parameter_values(ParameterValue)
/set_parameter_values(Option<Vec::<ParameterValue>>)
:
required: falseThe parameter values used with the pipeline.
- On success, responds with
ValidatePipelineDefinitionOutput
with field(s):validation_errors(Option<Vec::<ValidationError>>)
:Any validation errors that were found.
validation_warnings(Option<Vec::<ValidationWarning>>)
:Any validation warnings that were found.
errored(bool)
:Indicates whether there were validation errors.
- On failure, responds with
SdkError<ValidatePipelineDefinitionError>
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>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
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>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
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>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
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>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
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>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
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>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
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 underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
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);