pub struct PutIntegrationFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to PutIntegration
.
Sets up a method's integration.
Implementations§
Source§impl PutIntegrationFluentBuilder
impl PutIntegrationFluentBuilder
Sourcepub fn as_input(&self) -> &PutIntegrationInputBuilder
pub fn as_input(&self) -> &PutIntegrationInputBuilder
Access the PutIntegration as a reference.
Sourcepub async fn send(
self,
) -> Result<PutIntegrationOutput, SdkError<PutIntegrationError, HttpResponse>>
pub async fn send( self, ) -> Result<PutIntegrationOutput, SdkError<PutIntegrationError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<PutIntegrationOutput, PutIntegrationError, Self>
pub fn customize( self, ) -> CustomizableOperation<PutIntegrationOutput, PutIntegrationError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn rest_api_id(self, input: impl Into<String>) -> Self
pub fn rest_api_id(self, input: impl Into<String>) -> Self
The string identifier of the associated RestApi.
Sourcepub fn set_rest_api_id(self, input: Option<String>) -> Self
pub fn set_rest_api_id(self, input: Option<String>) -> Self
The string identifier of the associated RestApi.
Sourcepub fn get_rest_api_id(&self) -> &Option<String>
pub fn get_rest_api_id(&self) -> &Option<String>
The string identifier of the associated RestApi.
Sourcepub fn resource_id(self, input: impl Into<String>) -> Self
pub fn resource_id(self, input: impl Into<String>) -> Self
Specifies a put integration request's resource ID.
Sourcepub fn set_resource_id(self, input: Option<String>) -> Self
pub fn set_resource_id(self, input: Option<String>) -> Self
Specifies a put integration request's resource ID.
Sourcepub fn get_resource_id(&self) -> &Option<String>
pub fn get_resource_id(&self) -> &Option<String>
Specifies a put integration request's resource ID.
Sourcepub fn http_method(self, input: impl Into<String>) -> Self
pub fn http_method(self, input: impl Into<String>) -> Self
Specifies the HTTP method for the integration.
Sourcepub fn set_http_method(self, input: Option<String>) -> Self
pub fn set_http_method(self, input: Option<String>) -> Self
Specifies the HTTP method for the integration.
Sourcepub fn get_http_method(&self) -> &Option<String>
pub fn get_http_method(&self) -> &Option<String>
Specifies the HTTP method for the integration.
Sourcepub fn type(self, input: IntegrationType) -> Self
pub fn type(self, input: IntegrationType) -> Self
Specifies a put integration input's type.
Sourcepub fn set_type(self, input: Option<IntegrationType>) -> Self
pub fn set_type(self, input: Option<IntegrationType>) -> Self
Specifies a put integration input's type.
Sourcepub fn get_type(&self) -> &Option<IntegrationType>
pub fn get_type(&self) -> &Option<IntegrationType>
Specifies a put integration input's type.
Sourcepub fn integration_http_method(self, input: impl Into<String>) -> Self
pub fn integration_http_method(self, input: impl Into<String>) -> Self
The HTTP method for the integration.
Sourcepub fn set_integration_http_method(self, input: Option<String>) -> Self
pub fn set_integration_http_method(self, input: Option<String>) -> Self
The HTTP method for the integration.
Sourcepub fn get_integration_http_method(&self) -> &Option<String>
pub fn get_integration_http_method(&self) -> &Option<String>
The HTTP method for the integration.
Sourcepub fn uri(self, input: impl Into<String>) -> Self
pub fn uri(self, input: impl Into<String>) -> Self
Specifies Uniform Resource Identifier (URI) of the integration endpoint. For HTTP or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api
}. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject
, the uri
can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
.
Sourcepub fn set_uri(self, input: Option<String>) -> Self
pub fn set_uri(self, input: Option<String>) -> Self
Specifies Uniform Resource Identifier (URI) of the integration endpoint. For HTTP or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api
}. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject
, the uri
can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
.
Sourcepub fn get_uri(&self) -> &Option<String>
pub fn get_uri(&self) -> &Option<String>
Specifies Uniform Resource Identifier (URI) of the integration endpoint. For HTTP or HTTP_PROXY
integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType
is not VPC_LINK
, or private integration, where connectionType
is VPC_LINK
. For a private HTTP integration, the URI is not used for routing. For AWS
or AWS_PROXY
integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api
}. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject
, the uri
can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}
or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
.
Sourcepub fn connection_type(self, input: ConnectionType) -> Self
pub fn connection_type(self, input: ConnectionType) -> Self
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
Sourcepub fn set_connection_type(self, input: Option<ConnectionType>) -> Self
pub fn set_connection_type(self, input: Option<ConnectionType>) -> Self
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
Sourcepub fn get_connection_type(&self) -> &Option<ConnectionType>
pub fn get_connection_type(&self) -> &Option<ConnectionType>
The type of the network connection to the integration endpoint. The valid value is INTERNET
for connections through the public routable internet or VPC_LINK
for private connections between API Gateway and a network load balancer in a VPC. The default value is INTERNET
.
Sourcepub fn connection_id(self, input: impl Into<String>) -> Self
pub fn connection_id(self, input: impl Into<String>) -> Self
The ID of the VpcLink used for the integration. Specify this value only if you specify VPC_LINK
as the connection type.
Sourcepub fn set_connection_id(self, input: Option<String>) -> Self
pub fn set_connection_id(self, input: Option<String>) -> Self
The ID of the VpcLink used for the integration. Specify this value only if you specify VPC_LINK
as the connection type.
Sourcepub fn get_connection_id(&self) -> &Option<String>
pub fn get_connection_id(&self) -> &Option<String>
The ID of the VpcLink used for the integration. Specify this value only if you specify VPC_LINK
as the connection type.
Sourcepub fn credentials(self, input: impl Into<String>) -> Self
pub fn credentials(self, input: impl Into<String>) -> Self
Specifies whether credentials are required for a put integration.
Sourcepub fn set_credentials(self, input: Option<String>) -> Self
pub fn set_credentials(self, input: Option<String>) -> Self
Specifies whether credentials are required for a put integration.
Sourcepub fn get_credentials(&self) -> &Option<String>
pub fn get_credentials(&self) -> &Option<String>
Specifies whether credentials are required for a put integration.
Sourcepub fn request_parameters(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn request_parameters( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to requestParameters
.
To override the contents of this collection use set_request_parameters
.
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
Sourcepub fn set_request_parameters(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_request_parameters( self, input: Option<HashMap<String, String>>, ) -> Self
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
Sourcepub fn get_request_parameters(&self) -> &Option<HashMap<String, String>>
pub fn get_request_parameters(&self) -> &Option<HashMap<String, String>>
A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end. The method request parameter value must match the pattern of method.request.{location}.{name}
, where location
is querystring
, path
, or header
and name
must be a valid and unique method request parameter name.
Sourcepub fn request_templates(
self,
k: impl Into<String>,
v: impl Into<String>,
) -> Self
pub fn request_templates( self, k: impl Into<String>, v: impl Into<String>, ) -> Self
Adds a key-value pair to requestTemplates
.
To override the contents of this collection use set_request_templates
.
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
Sourcepub fn set_request_templates(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_request_templates( self, input: Option<HashMap<String, String>>, ) -> Self
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
Sourcepub fn get_request_templates(&self) -> &Option<HashMap<String, String>>
pub fn get_request_templates(&self) -> &Option<HashMap<String, String>>
Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.
Sourcepub fn passthrough_behavior(self, input: impl Into<String>) -> Self
pub fn passthrough_behavior(self, input: impl Into<String>) -> Self
Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates
property on the Integration resource. There are three valid values: WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and NEVER
.
Sourcepub fn set_passthrough_behavior(self, input: Option<String>) -> Self
pub fn set_passthrough_behavior(self, input: Option<String>) -> Self
Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates
property on the Integration resource. There are three valid values: WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and NEVER
.
Sourcepub fn get_passthrough_behavior(&self) -> &Option<String>
pub fn get_passthrough_behavior(&self) -> &Option<String>
Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates
property on the Integration resource. There are three valid values: WHEN_NO_MATCH
, WHEN_NO_TEMPLATES
, and NEVER
.
Sourcepub fn cache_namespace(self, input: impl Into<String>) -> Self
pub fn cache_namespace(self, input: impl Into<String>) -> Self
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
Sourcepub fn set_cache_namespace(self, input: Option<String>) -> Self
pub fn set_cache_namespace(self, input: Option<String>) -> Self
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
Sourcepub fn get_cache_namespace(&self) -> &Option<String>
pub fn get_cache_namespace(&self) -> &Option<String>
Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace
. You can specify the same cacheNamespace
across resources to return the same cached data for requests to different resources.
Sourcepub fn cache_key_parameters(self, input: impl Into<String>) -> Self
pub fn cache_key_parameters(self, input: impl Into<String>) -> Self
Appends an item to cacheKeyParameters
.
To override the contents of this collection use set_cache_key_parameters
.
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
Sourcepub fn set_cache_key_parameters(self, input: Option<Vec<String>>) -> Self
pub fn set_cache_key_parameters(self, input: Option<Vec<String>>) -> Self
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
Sourcepub fn get_cache_key_parameters(&self) -> &Option<Vec<String>>
pub fn get_cache_key_parameters(&self) -> &Option<Vec<String>>
A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters
, these parameters must also be specified for Method requestParameters
.
Sourcepub fn content_handling(self, input: ContentHandlingStrategy) -> Self
pub fn content_handling(self, input: ContentHandlingStrategy) -> Self
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
Sourcepub fn set_content_handling(
self,
input: Option<ContentHandlingStrategy>,
) -> Self
pub fn set_content_handling( self, input: Option<ContentHandlingStrategy>, ) -> Self
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
Sourcepub fn get_content_handling(&self) -> &Option<ContentHandlingStrategy>
pub fn get_content_handling(&self) -> &Option<ContentHandlingStrategy>
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY
and CONVERT_TO_TEXT
, with the following behaviors:
If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehavior
is configured to support payload pass-through.
Sourcepub fn timeout_in_millis(self, input: i32) -> Self
pub fn timeout_in_millis(self, input: i32) -> Self
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.
Sourcepub fn set_timeout_in_millis(self, input: Option<i32>) -> Self
pub fn set_timeout_in_millis(self, input: Option<i32>) -> Self
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.
Sourcepub fn get_timeout_in_millis(&self) -> &Option<i32>
pub fn get_timeout_in_millis(&self) -> &Option<i32>
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. You can increase the default value to longer than 29 seconds for Regional or private APIs only.
Sourcepub fn tls_config(self, input: TlsConfig) -> Self
pub fn tls_config(self, input: TlsConfig) -> Self
Specifies the TLS configuration for an integration.
Sourcepub fn set_tls_config(self, input: Option<TlsConfig>) -> Self
pub fn set_tls_config(self, input: Option<TlsConfig>) -> Self
Specifies the TLS configuration for an integration.
Sourcepub fn get_tls_config(&self) -> &Option<TlsConfig>
pub fn get_tls_config(&self) -> &Option<TlsConfig>
Specifies the TLS configuration for an integration.
Trait Implementations§
Source§impl Clone for PutIntegrationFluentBuilder
impl Clone for PutIntegrationFluentBuilder
Source§fn clone(&self) -> PutIntegrationFluentBuilder
fn clone(&self) -> PutIntegrationFluentBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PutIntegrationFluentBuilder
impl !RefUnwindSafe for PutIntegrationFluentBuilder
impl Send for PutIntegrationFluentBuilder
impl Sync for PutIntegrationFluentBuilder
impl Unpin for PutIntegrationFluentBuilder
impl !UnwindSafe for PutIntegrationFluentBuilder
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);