#[non_exhaustive]pub struct CreateCapacityReservationInputBuilder { /* private fields */ }
Expand description
A builder for CreateCapacityReservationInput
.
Implementations§
Source§impl CreateCapacityReservationInputBuilder
impl CreateCapacityReservationInputBuilder
Sourcepub fn client_token(self, input: impl Into<String>) -> Self
pub fn client_token(self, input: impl Into<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
Sourcepub fn set_client_token(self, input: Option<String>) -> Self
pub fn set_client_token(self, input: Option<String>) -> Self
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
Sourcepub fn get_client_token(&self) -> &Option<String>
pub fn get_client_token(&self) -> &Option<String>
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
Sourcepub fn instance_type(self, input: impl Into<String>) -> Self
pub fn instance_type(self, input: impl Into<String>) -> Self
The instance type for which to reserve capacity.
You can request future-dated Capacity Reservations for instance types in the C, M, R, I, and T instance families only.
For more information, see Instance types in the Amazon EC2 User Guide.
This field is required.Sourcepub fn set_instance_type(self, input: Option<String>) -> Self
pub fn set_instance_type(self, input: Option<String>) -> Self
The instance type for which to reserve capacity.
You can request future-dated Capacity Reservations for instance types in the C, M, R, I, and T instance families only.
For more information, see Instance types in the Amazon EC2 User Guide.
Sourcepub fn get_instance_type(&self) -> &Option<String>
pub fn get_instance_type(&self) -> &Option<String>
The instance type for which to reserve capacity.
You can request future-dated Capacity Reservations for instance types in the C, M, R, I, and T instance families only.
For more information, see Instance types in the Amazon EC2 User Guide.
Sourcepub fn instance_platform(
self,
input: CapacityReservationInstancePlatform,
) -> Self
pub fn instance_platform( self, input: CapacityReservationInstancePlatform, ) -> Self
The type of operating system for which to reserve capacity.
This field is required.Sourcepub fn set_instance_platform(
self,
input: Option<CapacityReservationInstancePlatform>,
) -> Self
pub fn set_instance_platform( self, input: Option<CapacityReservationInstancePlatform>, ) -> Self
The type of operating system for which to reserve capacity.
Sourcepub fn get_instance_platform(
&self,
) -> &Option<CapacityReservationInstancePlatform>
pub fn get_instance_platform( &self, ) -> &Option<CapacityReservationInstancePlatform>
The type of operating system for which to reserve capacity.
Sourcepub fn availability_zone(self, input: impl Into<String>) -> Self
pub fn availability_zone(self, input: impl Into<String>) -> Self
The Availability Zone in which to create the Capacity Reservation.
Sourcepub fn set_availability_zone(self, input: Option<String>) -> Self
pub fn set_availability_zone(self, input: Option<String>) -> Self
The Availability Zone in which to create the Capacity Reservation.
Sourcepub fn get_availability_zone(&self) -> &Option<String>
pub fn get_availability_zone(&self) -> &Option<String>
The Availability Zone in which to create the Capacity Reservation.
Sourcepub fn availability_zone_id(self, input: impl Into<String>) -> Self
pub fn availability_zone_id(self, input: impl Into<String>) -> Self
The ID of the Availability Zone in which to create the Capacity Reservation.
Sourcepub fn set_availability_zone_id(self, input: Option<String>) -> Self
pub fn set_availability_zone_id(self, input: Option<String>) -> Self
The ID of the Availability Zone in which to create the Capacity Reservation.
Sourcepub fn get_availability_zone_id(&self) -> &Option<String>
pub fn get_availability_zone_id(&self) -> &Option<String>
The ID of the Availability Zone in which to create the Capacity Reservation.
Sourcepub fn tenancy(self, input: CapacityReservationTenancy) -> Self
pub fn tenancy(self, input: CapacityReservationTenancy) -> Self
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
-
default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts. -
dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
Sourcepub fn set_tenancy(self, input: Option<CapacityReservationTenancy>) -> Self
pub fn set_tenancy(self, input: Option<CapacityReservationTenancy>) -> Self
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
-
default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts. -
dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
Sourcepub fn get_tenancy(&self) -> &Option<CapacityReservationTenancy>
pub fn get_tenancy(&self) -> &Option<CapacityReservationTenancy>
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:
-
default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web Services accounts. -
dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
Sourcepub fn instance_count(self, input: i32) -> Self
pub fn instance_count(self, input: i32) -> Self
The number of instances for which to reserve capacity.
You can request future-dated Capacity Reservations for an instance count with a minimum of 100 vCPUs. For example, if you request a future-dated Capacity Reservation for m5.xlarge
instances, you must request at least 25 instances (25 * m5.xlarge = 100 vCPUs).
Valid range: 1 - 1000
This field is required.Sourcepub fn set_instance_count(self, input: Option<i32>) -> Self
pub fn set_instance_count(self, input: Option<i32>) -> Self
The number of instances for which to reserve capacity.
You can request future-dated Capacity Reservations for an instance count with a minimum of 100 vCPUs. For example, if you request a future-dated Capacity Reservation for m5.xlarge
instances, you must request at least 25 instances (25 * m5.xlarge = 100 vCPUs).
Valid range: 1 - 1000
Sourcepub fn get_instance_count(&self) -> &Option<i32>
pub fn get_instance_count(&self) -> &Option<i32>
The number of instances for which to reserve capacity.
You can request future-dated Capacity Reservations for an instance count with a minimum of 100 vCPUs. For example, if you request a future-dated Capacity Reservation for m5.xlarge
instances, you must request at least 25 instances (25 * m5.xlarge = 100 vCPUs).
Valid range: 1 - 1000
Sourcepub fn ebs_optimized(self, input: bool) -> Self
pub fn ebs_optimized(self, input: bool) -> Self
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
Sourcepub fn set_ebs_optimized(self, input: Option<bool>) -> Self
pub fn set_ebs_optimized(self, input: Option<bool>) -> Self
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
Sourcepub fn get_ebs_optimized(&self) -> &Option<bool>
pub fn get_ebs_optimized(&self) -> &Option<bool>
Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
Sourcepub fn ephemeral_storage(self, input: bool) -> Self
pub fn ephemeral_storage(self, input: bool) -> Self
Deprecated.
Sourcepub fn set_ephemeral_storage(self, input: Option<bool>) -> Self
pub fn set_ephemeral_storage(self, input: Option<bool>) -> Self
Deprecated.
Sourcepub fn get_ephemeral_storage(&self) -> &Option<bool>
pub fn get_ephemeral_storage(&self) -> &Option<bool>
Deprecated.
Sourcepub fn end_date(self, input: DateTime) -> Self
pub fn end_date(self, input: DateTime) -> Self
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired
when it reaches its end date and time.
You must provide an EndDate
value if EndDateType
is limited
. Omit EndDate
if EndDateType
is unlimited
.
If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.
Sourcepub fn set_end_date(self, input: Option<DateTime>) -> Self
pub fn set_end_date(self, input: Option<DateTime>) -> Self
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired
when it reaches its end date and time.
You must provide an EndDate
value if EndDateType
is limited
. Omit EndDate
if EndDateType
is unlimited
.
If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.
Sourcepub fn get_end_date(&self) -> &Option<DateTime>
pub fn get_end_date(&self) -> &Option<DateTime>
The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to expired
when it reaches its end date and time.
You must provide an EndDate
value if EndDateType
is limited
. Omit EndDate
if EndDateType
is unlimited
.
If the EndDateType
is limited
, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
If you are requesting a future-dated Capacity Reservation, you can't specify an end date and time that is within the commitment duration.
Sourcepub fn end_date_type(self, input: EndDateType) -> Self
pub fn end_date_type(self, input: EndDateType) -> Self
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
-
unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide anEndDate
if theEndDateType
isunlimited
. -
limited
- The Capacity Reservation expires automatically at a specified date and time. You must provide anEndDate
value if theEndDateType
value islimited
.
Sourcepub fn set_end_date_type(self, input: Option<EndDateType>) -> Self
pub fn set_end_date_type(self, input: Option<EndDateType>) -> Self
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
-
unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide anEndDate
if theEndDateType
isunlimited
. -
limited
- The Capacity Reservation expires automatically at a specified date and time. You must provide anEndDate
value if theEndDateType
value islimited
.
Sourcepub fn get_end_date_type(&self) -> &Option<EndDateType>
pub fn get_end_date_type(&self) -> &Option<EndDateType>
Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following end types:
-
unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide anEndDate
if theEndDateType
isunlimited
. -
limited
- The Capacity Reservation expires automatically at a specified date and time. You must provide anEndDate
value if theEndDateType
value islimited
.
Sourcepub fn instance_match_criteria(self, input: InstanceMatchCriteria) -> Self
pub fn instance_match_criteria(self, input: InstanceMatchCriteria) -> Self
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
-
open
- The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters. -
targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
If you are requesting a future-dated Capacity Reservation, you must specify targeted
.
Default: open
Sourcepub fn set_instance_match_criteria(
self,
input: Option<InstanceMatchCriteria>,
) -> Self
pub fn set_instance_match_criteria( self, input: Option<InstanceMatchCriteria>, ) -> Self
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
-
open
- The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters. -
targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
If you are requesting a future-dated Capacity Reservation, you must specify targeted
.
Default: open
Sourcepub fn get_instance_match_criteria(&self) -> &Option<InstanceMatchCriteria>
pub fn get_instance_match_criteria(&self) -> &Option<InstanceMatchCriteria>
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
-
open
- The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters. -
targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
If you are requesting a future-dated Capacity Reservation, you must specify targeted
.
Default: open
Sourcepub fn tag_specifications(self, input: TagSpecification) -> Self
pub fn tag_specifications(self, input: TagSpecification) -> Self
Appends an item to tag_specifications
.
To override the contents of this collection use set_tag_specifications
.
The tags to apply to the Capacity Reservation during launch.
Sourcepub fn set_tag_specifications(
self,
input: Option<Vec<TagSpecification>>,
) -> Self
pub fn set_tag_specifications( self, input: Option<Vec<TagSpecification>>, ) -> Self
The tags to apply to the Capacity Reservation during launch.
Sourcepub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
pub fn get_tag_specifications(&self) -> &Option<Vec<TagSpecification>>
The tags to apply to the Capacity Reservation during launch.
Sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Sourcepub fn get_dry_run(&self) -> &Option<bool>
pub fn get_dry_run(&self) -> &Option<bool>
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
Sourcepub fn outpost_arn(self, input: impl Into<String>) -> Self
pub fn outpost_arn(self, input: impl Into<String>) -> Self
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
Sourcepub fn set_outpost_arn(self, input: Option<String>) -> Self
pub fn set_outpost_arn(self, input: Option<String>) -> Self
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
Sourcepub fn get_outpost_arn(&self) -> &Option<String>
pub fn get_outpost_arn(&self) -> &Option<String>
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
Sourcepub fn placement_group_arn(self, input: impl Into<String>) -> Self
pub fn placement_group_arn(self, input: impl Into<String>) -> Self
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
Sourcepub fn set_placement_group_arn(self, input: Option<String>) -> Self
pub fn set_placement_group_arn(self, input: Option<String>) -> Self
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
Sourcepub fn get_placement_group_arn(&self) -> &Option<String>
pub fn get_placement_group_arn(&self) -> &Option<String>
Not supported for future-dated Capacity Reservations.
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation. For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide.
Sourcepub fn start_date(self, input: DateTime) -> Self
pub fn start_date(self, input: DateTime) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ
).
You can request a future-dated Capacity Reservation between 5 and 120 days in advance.
Sourcepub fn set_start_date(self, input: Option<DateTime>) -> Self
pub fn set_start_date(self, input: Option<DateTime>) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ
).
You can request a future-dated Capacity Reservation between 5 and 120 days in advance.
Sourcepub fn get_start_date(&self) -> &Option<DateTime>
pub fn get_start_date(&self) -> &Option<DateTime>
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
The date and time at which the future-dated Capacity Reservation should become available for use, in the ISO8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ
).
You can request a future-dated Capacity Reservation between 5 and 120 days in advance.
Sourcepub fn commitment_duration(self, input: i64) -> Self
pub fn commitment_duration(self, input: i64) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.
The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the active
state in your account after it has been delivered.
For more information, see Commitment duration.
Sourcepub fn set_commitment_duration(self, input: Option<i64>) -> Self
pub fn set_commitment_duration(self, input: Option<i64>) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.
The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the active
state in your account after it has been delivered.
For more information, see Commitment duration.
Sourcepub fn get_commitment_duration(&self) -> &Option<i64>
pub fn get_commitment_duration(&self) -> &Option<i64>
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Specify a commitment duration, in seconds, for the future-dated Capacity Reservation.
The commitment duration is a minimum duration for which you commit to having the future-dated Capacity Reservation in the active
state in your account after it has been delivered.
For more information, see Commitment duration.
Sourcepub fn delivery_preference(
self,
input: CapacityReservationDeliveryPreference,
) -> Self
pub fn delivery_preference( self, input: CapacityReservationDeliveryPreference, ) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.
The only supported value is incremental
.
Sourcepub fn set_delivery_preference(
self,
input: Option<CapacityReservationDeliveryPreference>,
) -> Self
pub fn set_delivery_preference( self, input: Option<CapacityReservationDeliveryPreference>, ) -> Self
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.
The only supported value is incremental
.
Sourcepub fn get_delivery_preference(
&self,
) -> &Option<CapacityReservationDeliveryPreference>
pub fn get_delivery_preference( &self, ) -> &Option<CapacityReservationDeliveryPreference>
Required for future-dated Capacity Reservations only. To create a Capacity Reservation for immediate use, omit this parameter.
Indicates that the requested capacity will be delivered in addition to any running instances or reserved capacity that you have in your account at the requested date and time.
The only supported value is incremental
.
Sourcepub fn build(self) -> Result<CreateCapacityReservationInput, BuildError>
pub fn build(self) -> Result<CreateCapacityReservationInput, BuildError>
Consumes the builder and constructs a CreateCapacityReservationInput
.
Source§impl CreateCapacityReservationInputBuilder
impl CreateCapacityReservationInputBuilder
Sourcepub async fn send_with(
self,
client: &Client,
) -> Result<CreateCapacityReservationOutput, SdkError<CreateCapacityReservationError, HttpResponse>>
pub async fn send_with( self, client: &Client, ) -> Result<CreateCapacityReservationOutput, SdkError<CreateCapacityReservationError, HttpResponse>>
Sends a request with this input using the given client.
Trait Implementations§
Source§impl Clone for CreateCapacityReservationInputBuilder
impl Clone for CreateCapacityReservationInputBuilder
Source§fn clone(&self) -> CreateCapacityReservationInputBuilder
fn clone(&self) -> CreateCapacityReservationInputBuilder
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 CreateCapacityReservationInputBuilder
impl Default for CreateCapacityReservationInputBuilder
Source§fn default() -> CreateCapacityReservationInputBuilder
fn default() -> CreateCapacityReservationInputBuilder
Source§impl PartialEq for CreateCapacityReservationInputBuilder
impl PartialEq for CreateCapacityReservationInputBuilder
Source§fn eq(&self, other: &CreateCapacityReservationInputBuilder) -> bool
fn eq(&self, other: &CreateCapacityReservationInputBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for CreateCapacityReservationInputBuilder
Auto Trait Implementations§
impl Freeze for CreateCapacityReservationInputBuilder
impl RefUnwindSafe for CreateCapacityReservationInputBuilder
impl Send for CreateCapacityReservationInputBuilder
impl Sync for CreateCapacityReservationInputBuilder
impl Unpin for CreateCapacityReservationInputBuilder
impl UnwindSafe for CreateCapacityReservationInputBuilder
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);