#[non_exhaustive]pub struct UpdateIntegrationOutputBuilder { /* private fields */ }
Expand description
A builder for UpdateIntegrationOutput
.
Implementations§
Source§impl UpdateIntegrationOutputBuilder
impl UpdateIntegrationOutputBuilder
Sourcepub fn type(self, input: IntegrationType) -> Self
pub fn type(self, input: IntegrationType) -> Self
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Sourcepub fn set_type(self, input: Option<IntegrationType>) -> Self
pub fn set_type(self, input: Option<IntegrationType>) -> Self
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Sourcepub fn get_type(&self) -> &Option<IntegrationType>
pub fn get_type(&self) -> &Option<IntegrationType>
Specifies an API method integration type. The valid value is one of the following:
For the HTTP and HTTP proxy integrations, each integration can specify a protocol (http/https
), port and path. Standard 80 and 443 ports are supported as well as custom ports above 1024. An HTTP or HTTP proxy integration with a connectionType
of VPC_LINK
is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Sourcepub fn http_method(self, input: impl Into<String>) -> Self
pub fn http_method(self, input: impl Into<String>) -> Self
Specifies the integration's HTTP method type. For the Type property, if you specify MOCK
, this property is optional. For Lambda integrations, you must set the integration method to POST
. For all other types, you must specify this property.
Sourcepub fn set_http_method(self, input: Option<String>) -> Self
pub fn set_http_method(self, input: Option<String>) -> Self
Specifies the integration's HTTP method type. For the Type property, if you specify MOCK
, this property is optional. For Lambda integrations, you must set the integration method to POST
. For all other types, you must specify this property.
Sourcepub fn get_http_method(&self) -> &Option<String>
pub fn get_http_method(&self) -> &Option<String>
Specifies the integration's HTTP method type. For the Type property, if you specify MOCK
, this property is optional. For Lambda integrations, you must set the integration method to POST
. For all other types, you must specify this property.
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 standard integrations. If connectionType
is VPC_LINK
specify the Network Load Balancer DNS name. 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 standard integrations. If connectionType
is VPC_LINK
specify the Network Load Balancer DNS name. 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 standard integrations. If connectionType
is VPC_LINK
specify the Network Load Balancer DNS name. 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 when connectionType=VPC_LINK
and undefined, otherwise.
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 when connectionType=VPC_LINK
and undefined, otherwise.
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 when connectionType=VPC_LINK
and undefined, otherwise.
Sourcepub fn credentials(self, input: impl Into<String>) -> Self
pub fn credentials(self, input: impl Into<String>) -> Self
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported Amazon Web Services services, specify null.
Sourcepub fn set_credentials(self, input: Option<String>) -> Self
pub fn set_credentials(self, input: Option<String>) -> Self
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported Amazon Web Services services, specify null.
Sourcepub fn get_credentials(&self) -> &Option<String>
pub fn get_credentials(&self) -> &Option<String>
Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*
. To use resource-based permissions on supported Amazon Web Services services, specify null.
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 request_parameters
.
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 request_templates
.
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 how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
Sourcepub fn set_passthrough_behavior(self, input: Option<String>) -> Self
pub fn set_passthrough_behavior(self, input: Option<String>) -> Self
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
Sourcepub fn get_passthrough_behavior(&self) -> &Option<String>
pub fn get_passthrough_behavior(&self) -> &Option<String>
Specifies how the method request body of an unmapped content type will be passed through the integration request to the back end without transformation. A content type is unmapped if no mapping template is defined in the integration or the content type does not match any of the mapped content types, as specified in requestTemplates
. The valid value is one of the following: WHEN_NO_MATCH
: passes the method request body through the integration request to the back end without transformation when the method request content type does not match any content type associated with the mapping templates defined in the integration request. WHEN_NO_TEMPLATES
: passes the method request body through the integration request to the back end without transformation when no mapping template is defined in the integration request. If a template is defined when this option is selected, the method request of an unmapped content-type will be rejected with an HTTP 415 Unsupported Media Type response. NEVER
: rejects the method request with an HTTP 415 Unsupported Media Type response when either the method request content type does not match any content type associated with the mapping templates defined in the integration request or no mapping template is defined in the integration request.
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 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 cache_key_parameters
.
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 integration_responses(
self,
k: impl Into<String>,
v: IntegrationResponse,
) -> Self
pub fn integration_responses( self, k: impl Into<String>, v: IntegrationResponse, ) -> Self
Adds a key-value pair to integration_responses
.
To override the contents of this collection use set_integration_responses
.
Specifies the integration's responses.
Sourcepub fn set_integration_responses(
self,
input: Option<HashMap<String, IntegrationResponse>>,
) -> Self
pub fn set_integration_responses( self, input: Option<HashMap<String, IntegrationResponse>>, ) -> Self
Specifies the integration's responses.
Sourcepub fn get_integration_responses(
&self,
) -> &Option<HashMap<String, IntegrationResponse>>
pub fn get_integration_responses( &self, ) -> &Option<HashMap<String, IntegrationResponse>>
Specifies the integration's responses.
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.
Sourcepub fn build(self) -> UpdateIntegrationOutput
pub fn build(self) -> UpdateIntegrationOutput
Consumes the builder and constructs a UpdateIntegrationOutput
.
Trait Implementations§
Source§impl Clone for UpdateIntegrationOutputBuilder
impl Clone for UpdateIntegrationOutputBuilder
Source§fn clone(&self) -> UpdateIntegrationOutputBuilder
fn clone(&self) -> UpdateIntegrationOutputBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for UpdateIntegrationOutputBuilder
impl Default for UpdateIntegrationOutputBuilder
Source§fn default() -> UpdateIntegrationOutputBuilder
fn default() -> UpdateIntegrationOutputBuilder
Source§impl PartialEq for UpdateIntegrationOutputBuilder
impl PartialEq for UpdateIntegrationOutputBuilder
Source§fn eq(&self, other: &UpdateIntegrationOutputBuilder) -> bool
fn eq(&self, other: &UpdateIntegrationOutputBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for UpdateIntegrationOutputBuilder
Auto Trait Implementations§
impl Freeze for UpdateIntegrationOutputBuilder
impl RefUnwindSafe for UpdateIntegrationOutputBuilder
impl Send for UpdateIntegrationOutputBuilder
impl Sync for UpdateIntegrationOutputBuilder
impl Unpin for UpdateIntegrationOutputBuilder
impl UnwindSafe for UpdateIntegrationOutputBuilder
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);