#[non_exhaustive]pub struct CreateFleetInput {Show 23 fields
pub name: Option<String>,
pub description: Option<String>,
pub build_id: Option<String>,
pub script_id: Option<String>,
pub server_launch_path: Option<String>,
pub server_launch_parameters: Option<String>,
pub log_paths: Option<Vec<String>>,
pub ec2_instance_type: Option<Ec2InstanceType>,
pub ec2_inbound_permissions: Option<Vec<IpPermission>>,
pub new_game_session_protection_policy: Option<ProtectionPolicy>,
pub runtime_configuration: Option<RuntimeConfiguration>,
pub resource_creation_limit_policy: Option<ResourceCreationLimitPolicy>,
pub metric_groups: Option<Vec<String>>,
pub peer_vpc_aws_account_id: Option<String>,
pub peer_vpc_id: Option<String>,
pub fleet_type: Option<FleetType>,
pub instance_role_arn: Option<String>,
pub certificate_configuration: Option<CertificateConfiguration>,
pub locations: Option<Vec<LocationConfiguration>>,
pub tags: Option<Vec<Tag>>,
pub compute_type: Option<ComputeType>,
pub anywhere_configuration: Option<AnywhereConfiguration>,
pub instance_role_credentials_provider: Option<InstanceRoleCredentialsProvider>,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: Option<String>
A descriptive label that is associated with a fleet. Fleet names do not need to be unique.
description: Option<String>
A description for the fleet.
build_id: Option<String>
The unique identifier for a custom game server build to be deployed to a fleet with compute type EC2
. You can use either the build ID or ARN. The build must be uploaded to Amazon GameLift Servers and in READY
status. This fleet property can't be changed after the fleet is created.
script_id: Option<String>
The unique identifier for a Realtime configuration script to be deployed to a fleet with compute type EC2
. You can use either the script ID or ARN. Scripts must be uploaded to Amazon GameLift Servers prior to creating the fleet. This fleet property can't be changed after the fleet is created.
server_launch_path: Option<String>
This parameter is no longer used. Specify a server launch path using the RuntimeConfiguration
parameter. Requests that use this parameter instead continue to be valid.
server_launch_parameters: Option<String>
This parameter is no longer used. Specify server launch parameters using the RuntimeConfiguration
parameter. Requests that use this parameter instead continue to be valid.
log_paths: Option<Vec<String>>
This parameter is no longer used. To specify where Amazon GameLift Servers should store log files once a server process shuts down, use the Amazon GameLift Servers server API ProcessReady()
and specify one or more directory paths in logParameters
. For more information, see Initialize the server process in the Amazon GameLift Servers Developer Guide.
ec2_instance_type: Option<Ec2InstanceType>
The Amazon GameLift Servers-supported Amazon EC2 instance type to use with managed EC2 fleets. Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity. See Amazon Elastic Compute Cloud Instance Types for detailed descriptions of Amazon EC2 instance types.
ec2_inbound_permissions: Option<Vec<IpPermission>>
The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet. Set this parameter for managed EC2 fleets. You can leave this parameter empty when creating the fleet, but you must call https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateFleetPortSettings to set it before players can connect to game sessions. As a best practice, we recommend opening ports for remote access only when you need them and closing them when you're finished. For Amazon GameLift Servers Realtime fleets, Amazon GameLift Servers automatically sets TCP and UDP ranges.
new_game_session_protection_policy: Option<ProtectionPolicy>
The status of termination protection for active game sessions on the fleet. By default, this property is set to NoProtection
. You can also set game session protection for an individual game session by calling UpdateGameSession.
-
NoProtection - Game sessions can be terminated during active gameplay as a result of a scale-down event.
-
FullProtection - Game sessions in
ACTIVE
status cannot be terminated during a scale-down event.
runtime_configuration: Option<RuntimeConfiguration>
Instructions for how to launch and run server processes on the fleet. Set runtime configuration for managed EC2 fleets. For an Anywhere fleets, set this parameter only if the fleet is running the Amazon GameLift Servers Agent. The runtime configuration defines one or more server process configurations. Each server process identifies a game executable or Realtime script file and the number of processes to run concurrently.
This parameter replaces the parameters ServerLaunchPath
and ServerLaunchParameters
, which are still supported for backward compatibility.
resource_creation_limit_policy: Option<ResourceCreationLimitPolicy>
A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.
metric_groups: Option<Vec<String>>
The name of an Amazon Web Services CloudWatch metric group to add this fleet to. A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.
peer_vpc_aws_account_id: Option<String>
Used when peering your Amazon GameLift Servers fleet with a VPC, the unique identifier for the Amazon Web Services account that owns the VPC. You can find your account ID in the Amazon Web Services Management Console under account settings.
peer_vpc_id: Option<String>
A unique identifier for a VPC with resources to be accessed by your Amazon GameLift Servers fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the Amazon Web Services Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Servers Fleets.
fleet_type: Option<FleetType>
Indicates whether to use On-Demand or Spot instances for this fleet. By default, this property is set to ON_DEMAND
. Learn more about when to use On-Demand versus Spot Instances. This fleet property can't be changed after the fleet is created.
instance_role_arn: Option<String>
A unique identifier for an IAM role that manages access to your Amazon Web Services services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN by using the IAM dashboard in the Amazon Web Services Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server. This fleet property can't be changed after the fleet is created.
certificate_configuration: Option<CertificateConfiguration>
Prompts Amazon GameLift Servers to generate a TLS/SSL certificate for the fleet. Amazon GameLift Servers uses the certificates to encrypt traffic between game clients and the game servers running on Amazon GameLift Servers. By default, the CertificateConfiguration
is DISABLED
. You can't change this property after you create the fleet.
Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition.
ACM isn't available in all Amazon Web Services regions. A fleet creation request with certificate generation enabled in an unsupported Region, fails with a 4xx error. For more information about the supported Regions, see Supported Regions in the Certificate Manager User Guide.
locations: Option<Vec<LocationConfiguration>>
A set of remote locations to deploy additional instances to and manage as a multi-location fleet. Use this parameter when creating a fleet in Amazon Web Services Regions that support multiple locations. You can add any Amazon Web Services Region or Local Zone that's supported by Amazon GameLift Servers. Provide a list of one or more Amazon Web Services Region codes, such as us-west-2
, or Local Zone names. When using this parameter, Amazon GameLift Servers requires you to include your home location in the request. For a list of supported Regions and Local Zones, see Amazon GameLift Servers service locations for managed hosting.
A list of labels to assign to the new fleet resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.
compute_type: Option<ComputeType>
The type of compute resource used to host your game servers.
-
EC2
– The game server build is deployed to Amazon EC2 instances for cloud hosting. This is the default setting. -
ANYWHERE
– Game servers and supporting software are deployed to compute resources that you provide and manage. With this compute type, you can also set theAnywhereConfiguration
parameter.
anywhere_configuration: Option<AnywhereConfiguration>
Amazon GameLift Servers Anywhere configuration options.
instance_role_credentials_provider: Option<InstanceRoleCredentialsProvider>
Prompts Amazon GameLift Servers to generate a shared credentials file for the IAM role that's defined in InstanceRoleArn
. The shared credentials file is stored on each fleet instance and refreshed as needed. Use shared credentials for applications that are deployed along with the game server executable, if the game server is integrated with server SDK version 5.x. For more information about using shared credentials, see Communicate with other Amazon Web Services resources from your fleets.
Implementations§
Source§impl CreateFleetInput
impl CreateFleetInput
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
A descriptive label that is associated with a fleet. Fleet names do not need to be unique.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
A description for the fleet.
Sourcepub fn build_id(&self) -> Option<&str>
pub fn build_id(&self) -> Option<&str>
The unique identifier for a custom game server build to be deployed to a fleet with compute type EC2
. You can use either the build ID or ARN. The build must be uploaded to Amazon GameLift Servers and in READY
status. This fleet property can't be changed after the fleet is created.
Sourcepub fn script_id(&self) -> Option<&str>
pub fn script_id(&self) -> Option<&str>
The unique identifier for a Realtime configuration script to be deployed to a fleet with compute type EC2
. You can use either the script ID or ARN. Scripts must be uploaded to Amazon GameLift Servers prior to creating the fleet. This fleet property can't be changed after the fleet is created.
Sourcepub fn server_launch_path(&self) -> Option<&str>
pub fn server_launch_path(&self) -> Option<&str>
This parameter is no longer used. Specify a server launch path using the RuntimeConfiguration
parameter. Requests that use this parameter instead continue to be valid.
Sourcepub fn server_launch_parameters(&self) -> Option<&str>
pub fn server_launch_parameters(&self) -> Option<&str>
This parameter is no longer used. Specify server launch parameters using the RuntimeConfiguration
parameter. Requests that use this parameter instead continue to be valid.
Sourcepub fn log_paths(&self) -> &[String]
pub fn log_paths(&self) -> &[String]
This parameter is no longer used. To specify where Amazon GameLift Servers should store log files once a server process shuts down, use the Amazon GameLift Servers server API ProcessReady()
and specify one or more directory paths in logParameters
. For more information, see Initialize the server process in the Amazon GameLift Servers Developer Guide.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .log_paths.is_none()
.
Sourcepub fn ec2_instance_type(&self) -> Option<&Ec2InstanceType>
pub fn ec2_instance_type(&self) -> Option<&Ec2InstanceType>
The Amazon GameLift Servers-supported Amazon EC2 instance type to use with managed EC2 fleets. Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity. See Amazon Elastic Compute Cloud Instance Types for detailed descriptions of Amazon EC2 instance types.
Sourcepub fn ec2_inbound_permissions(&self) -> &[IpPermission]
pub fn ec2_inbound_permissions(&self) -> &[IpPermission]
The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet. Set this parameter for managed EC2 fleets. You can leave this parameter empty when creating the fleet, but you must call https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateFleetPortSettings to set it before players can connect to game sessions. As a best practice, we recommend opening ports for remote access only when you need them and closing them when you're finished. For Amazon GameLift Servers Realtime fleets, Amazon GameLift Servers automatically sets TCP and UDP ranges.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .ec2_inbound_permissions.is_none()
.
Sourcepub fn new_game_session_protection_policy(&self) -> Option<&ProtectionPolicy>
pub fn new_game_session_protection_policy(&self) -> Option<&ProtectionPolicy>
The status of termination protection for active game sessions on the fleet. By default, this property is set to NoProtection
. You can also set game session protection for an individual game session by calling UpdateGameSession.
-
NoProtection - Game sessions can be terminated during active gameplay as a result of a scale-down event.
-
FullProtection - Game sessions in
ACTIVE
status cannot be terminated during a scale-down event.
Sourcepub fn runtime_configuration(&self) -> Option<&RuntimeConfiguration>
pub fn runtime_configuration(&self) -> Option<&RuntimeConfiguration>
Instructions for how to launch and run server processes on the fleet. Set runtime configuration for managed EC2 fleets. For an Anywhere fleets, set this parameter only if the fleet is running the Amazon GameLift Servers Agent. The runtime configuration defines one or more server process configurations. Each server process identifies a game executable or Realtime script file and the number of processes to run concurrently.
This parameter replaces the parameters ServerLaunchPath
and ServerLaunchParameters
, which are still supported for backward compatibility.
Sourcepub fn resource_creation_limit_policy(
&self,
) -> Option<&ResourceCreationLimitPolicy>
pub fn resource_creation_limit_policy( &self, ) -> Option<&ResourceCreationLimitPolicy>
A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.
Sourcepub fn metric_groups(&self) -> &[String]
pub fn metric_groups(&self) -> &[String]
The name of an Amazon Web Services CloudWatch metric group to add this fleet to. A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .metric_groups.is_none()
.
Sourcepub fn peer_vpc_aws_account_id(&self) -> Option<&str>
pub fn peer_vpc_aws_account_id(&self) -> Option<&str>
Used when peering your Amazon GameLift Servers fleet with a VPC, the unique identifier for the Amazon Web Services account that owns the VPC. You can find your account ID in the Amazon Web Services Management Console under account settings.
Sourcepub fn peer_vpc_id(&self) -> Option<&str>
pub fn peer_vpc_id(&self) -> Option<&str>
A unique identifier for a VPC with resources to be accessed by your Amazon GameLift Servers fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the Amazon Web Services Management Console. Learn more about VPC peering in VPC Peering with Amazon GameLift Servers Fleets.
Sourcepub fn fleet_type(&self) -> Option<&FleetType>
pub fn fleet_type(&self) -> Option<&FleetType>
Indicates whether to use On-Demand or Spot instances for this fleet. By default, this property is set to ON_DEMAND
. Learn more about when to use On-Demand versus Spot Instances. This fleet property can't be changed after the fleet is created.
Sourcepub fn instance_role_arn(&self) -> Option<&str>
pub fn instance_role_arn(&self) -> Option<&str>
A unique identifier for an IAM role that manages access to your Amazon Web Services services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role's ARN by using the IAM dashboard in the Amazon Web Services Management Console. Learn more about using on-box credentials for your game servers at Access external resources from a game server. This fleet property can't be changed after the fleet is created.
Sourcepub fn certificate_configuration(&self) -> Option<&CertificateConfiguration>
pub fn certificate_configuration(&self) -> Option<&CertificateConfiguration>
Prompts Amazon GameLift Servers to generate a TLS/SSL certificate for the fleet. Amazon GameLift Servers uses the certificates to encrypt traffic between game clients and the game servers running on Amazon GameLift Servers. By default, the CertificateConfiguration
is DISABLED
. You can't change this property after you create the fleet.
Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition.
ACM isn't available in all Amazon Web Services regions. A fleet creation request with certificate generation enabled in an unsupported Region, fails with a 4xx error. For more information about the supported Regions, see Supported Regions in the Certificate Manager User Guide.
Sourcepub fn locations(&self) -> &[LocationConfiguration]
pub fn locations(&self) -> &[LocationConfiguration]
A set of remote locations to deploy additional instances to and manage as a multi-location fleet. Use this parameter when creating a fleet in Amazon Web Services Regions that support multiple locations. You can add any Amazon Web Services Region or Local Zone that's supported by Amazon GameLift Servers. Provide a list of one or more Amazon Web Services Region codes, such as us-west-2
, or Local Zone names. When using this parameter, Amazon GameLift Servers requires you to include your home location in the request. For a list of supported Regions and Local Zones, see Amazon GameLift Servers service locations for managed hosting.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .locations.is_none()
.
A list of labels to assign to the new fleet resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .tags.is_none()
.
Sourcepub fn compute_type(&self) -> Option<&ComputeType>
pub fn compute_type(&self) -> Option<&ComputeType>
The type of compute resource used to host your game servers.
-
EC2
– The game server build is deployed to Amazon EC2 instances for cloud hosting. This is the default setting. -
ANYWHERE
– Game servers and supporting software are deployed to compute resources that you provide and manage. With this compute type, you can also set theAnywhereConfiguration
parameter.
Sourcepub fn anywhere_configuration(&self) -> Option<&AnywhereConfiguration>
pub fn anywhere_configuration(&self) -> Option<&AnywhereConfiguration>
Amazon GameLift Servers Anywhere configuration options.
Sourcepub fn instance_role_credentials_provider(
&self,
) -> Option<&InstanceRoleCredentialsProvider>
pub fn instance_role_credentials_provider( &self, ) -> Option<&InstanceRoleCredentialsProvider>
Prompts Amazon GameLift Servers to generate a shared credentials file for the IAM role that's defined in InstanceRoleArn
. The shared credentials file is stored on each fleet instance and refreshed as needed. Use shared credentials for applications that are deployed along with the game server executable, if the game server is integrated with server SDK version 5.x. For more information about using shared credentials, see Communicate with other Amazon Web Services resources from your fleets.
Source§impl CreateFleetInput
impl CreateFleetInput
Sourcepub fn builder() -> CreateFleetInputBuilder
pub fn builder() -> CreateFleetInputBuilder
Creates a new builder-style object to manufacture CreateFleetInput
.
Trait Implementations§
Source§impl Clone for CreateFleetInput
impl Clone for CreateFleetInput
Source§fn clone(&self) -> CreateFleetInput
fn clone(&self) -> CreateFleetInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CreateFleetInput
impl Debug for CreateFleetInput
Source§impl PartialEq for CreateFleetInput
impl PartialEq for CreateFleetInput
impl StructuralPartialEq for CreateFleetInput
Auto Trait Implementations§
impl Freeze for CreateFleetInput
impl RefUnwindSafe for CreateFleetInput
impl Send for CreateFleetInput
impl Sync for CreateFleetInput
impl Unpin for CreateFleetInput
impl UnwindSafe for CreateFleetInput
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);