#[non_exhaustive]pub struct KinesisStreamingSourceOptionsBuilder { /* private fields */ }
Expand description
A builder for KinesisStreamingSourceOptions
.
Implementations§
Source§impl KinesisStreamingSourceOptionsBuilder
impl KinesisStreamingSourceOptionsBuilder
Sourcepub fn endpoint_url(self, input: impl Into<String>) -> Self
pub fn endpoint_url(self, input: impl Into<String>) -> Self
The URL of the Kinesis endpoint.
Sourcepub fn set_endpoint_url(self, input: Option<String>) -> Self
pub fn set_endpoint_url(self, input: Option<String>) -> Self
The URL of the Kinesis endpoint.
Sourcepub fn get_endpoint_url(&self) -> &Option<String>
pub fn get_endpoint_url(&self) -> &Option<String>
The URL of the Kinesis endpoint.
Sourcepub fn stream_name(self, input: impl Into<String>) -> Self
pub fn stream_name(self, input: impl Into<String>) -> Self
The name of the Kinesis data stream.
Sourcepub fn set_stream_name(self, input: Option<String>) -> Self
pub fn set_stream_name(self, input: Option<String>) -> Self
The name of the Kinesis data stream.
Sourcepub fn get_stream_name(&self) -> &Option<String>
pub fn get_stream_name(&self) -> &Option<String>
The name of the Kinesis data stream.
Sourcepub fn classification(self, input: impl Into<String>) -> Self
pub fn classification(self, input: impl Into<String>) -> Self
An optional classification.
Sourcepub fn set_classification(self, input: Option<String>) -> Self
pub fn set_classification(self, input: Option<String>) -> Self
An optional classification.
Sourcepub fn get_classification(&self) -> &Option<String>
pub fn get_classification(&self) -> &Option<String>
An optional classification.
Sourcepub fn set_delimiter(self, input: Option<String>) -> Self
pub fn set_delimiter(self, input: Option<String>) -> Self
Specifies the delimiter character.
Sourcepub fn get_delimiter(&self) -> &Option<String>
pub fn get_delimiter(&self) -> &Option<String>
Specifies the delimiter character.
Sourcepub fn starting_position(self, input: StartingPosition) -> Self
pub fn starting_position(self, input: StartingPosition) -> Self
The starting position in the Kinesis data stream to read data from. The possible values are "latest"
, "trim_horizon"
, "earliest"
, or a timestamp string in UTC format in the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z
represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00-04:00"). The default value is "latest"
.
Note: Using a value that is a timestamp string in UTC format for "startingPosition" is supported only for Glue version 4.0 or later.
Sourcepub fn set_starting_position(self, input: Option<StartingPosition>) -> Self
pub fn set_starting_position(self, input: Option<StartingPosition>) -> Self
The starting position in the Kinesis data stream to read data from. The possible values are "latest"
, "trim_horizon"
, "earliest"
, or a timestamp string in UTC format in the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z
represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00-04:00"). The default value is "latest"
.
Note: Using a value that is a timestamp string in UTC format for "startingPosition" is supported only for Glue version 4.0 or later.
Sourcepub fn get_starting_position(&self) -> &Option<StartingPosition>
pub fn get_starting_position(&self) -> &Option<StartingPosition>
The starting position in the Kinesis data stream to read data from. The possible values are "latest"
, "trim_horizon"
, "earliest"
, or a timestamp string in UTC format in the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z
represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00-04:00"). The default value is "latest"
.
Note: Using a value that is a timestamp string in UTC format for "startingPosition" is supported only for Glue version 4.0 or later.
Sourcepub fn max_fetch_time_in_ms(self, input: i64) -> Self
pub fn max_fetch_time_in_ms(self, input: i64) -> Self
The maximum time spent for the job executor to read records for the current batch from the Kinesis data stream, specified in milliseconds (ms). Multiple GetRecords
API calls may be made within this time. The default value is 1000
.
Sourcepub fn set_max_fetch_time_in_ms(self, input: Option<i64>) -> Self
pub fn set_max_fetch_time_in_ms(self, input: Option<i64>) -> Self
The maximum time spent for the job executor to read records for the current batch from the Kinesis data stream, specified in milliseconds (ms). Multiple GetRecords
API calls may be made within this time. The default value is 1000
.
Sourcepub fn get_max_fetch_time_in_ms(&self) -> &Option<i64>
pub fn get_max_fetch_time_in_ms(&self) -> &Option<i64>
The maximum time spent for the job executor to read records for the current batch from the Kinesis data stream, specified in milliseconds (ms). Multiple GetRecords
API calls may be made within this time. The default value is 1000
.
Sourcepub fn max_fetch_records_per_shard(self, input: i64) -> Self
pub fn max_fetch_records_per_shard(self, input: i64) -> Self
The maximum number of records to fetch per shard in the Kinesis data stream per microbatch. Note: The client can exceed this limit if the streaming job has already read extra records from Kinesis (in the same get-records call). If MaxFetchRecordsPerShard
needs to be strict then it needs to be a multiple of MaxRecordPerRead
. The default value is 100000
.
Sourcepub fn set_max_fetch_records_per_shard(self, input: Option<i64>) -> Self
pub fn set_max_fetch_records_per_shard(self, input: Option<i64>) -> Self
The maximum number of records to fetch per shard in the Kinesis data stream per microbatch. Note: The client can exceed this limit if the streaming job has already read extra records from Kinesis (in the same get-records call). If MaxFetchRecordsPerShard
needs to be strict then it needs to be a multiple of MaxRecordPerRead
. The default value is 100000
.
Sourcepub fn get_max_fetch_records_per_shard(&self) -> &Option<i64>
pub fn get_max_fetch_records_per_shard(&self) -> &Option<i64>
The maximum number of records to fetch per shard in the Kinesis data stream per microbatch. Note: The client can exceed this limit if the streaming job has already read extra records from Kinesis (in the same get-records call). If MaxFetchRecordsPerShard
needs to be strict then it needs to be a multiple of MaxRecordPerRead
. The default value is 100000
.
Sourcepub fn max_record_per_read(self, input: i64) -> Self
pub fn max_record_per_read(self, input: i64) -> Self
The maximum number of records to fetch from the Kinesis data stream in each getRecords operation. The default value is 10000
.
Sourcepub fn set_max_record_per_read(self, input: Option<i64>) -> Self
pub fn set_max_record_per_read(self, input: Option<i64>) -> Self
The maximum number of records to fetch from the Kinesis data stream in each getRecords operation. The default value is 10000
.
Sourcepub fn get_max_record_per_read(&self) -> &Option<i64>
pub fn get_max_record_per_read(&self) -> &Option<i64>
The maximum number of records to fetch from the Kinesis data stream in each getRecords operation. The default value is 10000
.
Sourcepub fn add_idle_time_between_reads(self, input: bool) -> Self
pub fn add_idle_time_between_reads(self, input: bool) -> Self
Adds a time delay between two consecutive getRecords operations. The default value is "False"
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn set_add_idle_time_between_reads(self, input: Option<bool>) -> Self
pub fn set_add_idle_time_between_reads(self, input: Option<bool>) -> Self
Adds a time delay between two consecutive getRecords operations. The default value is "False"
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn get_add_idle_time_between_reads(&self) -> &Option<bool>
pub fn get_add_idle_time_between_reads(&self) -> &Option<bool>
Adds a time delay between two consecutive getRecords operations. The default value is "False"
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn idle_time_between_reads_in_ms(self, input: i64) -> Self
pub fn idle_time_between_reads_in_ms(self, input: i64) -> Self
The minimum time delay between two consecutive getRecords operations, specified in ms. The default value is 1000
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn set_idle_time_between_reads_in_ms(self, input: Option<i64>) -> Self
pub fn set_idle_time_between_reads_in_ms(self, input: Option<i64>) -> Self
The minimum time delay between two consecutive getRecords operations, specified in ms. The default value is 1000
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn get_idle_time_between_reads_in_ms(&self) -> &Option<i64>
pub fn get_idle_time_between_reads_in_ms(&self) -> &Option<i64>
The minimum time delay between two consecutive getRecords operations, specified in ms. The default value is 1000
. This option is only configurable for Glue version 2.0 and above.
Sourcepub fn describe_shard_interval(self, input: i64) -> Self
pub fn describe_shard_interval(self, input: i64) -> Self
The minimum time interval between two ListShards API calls for your script to consider resharding. The default value is 1s
.
Sourcepub fn set_describe_shard_interval(self, input: Option<i64>) -> Self
pub fn set_describe_shard_interval(self, input: Option<i64>) -> Self
The minimum time interval between two ListShards API calls for your script to consider resharding. The default value is 1s
.
Sourcepub fn get_describe_shard_interval(&self) -> &Option<i64>
pub fn get_describe_shard_interval(&self) -> &Option<i64>
The minimum time interval between two ListShards API calls for your script to consider resharding. The default value is 1s
.
Sourcepub fn num_retries(self, input: i32) -> Self
pub fn num_retries(self, input: i32) -> Self
The maximum number of retries for Kinesis Data Streams API requests. The default value is 3
.
Sourcepub fn set_num_retries(self, input: Option<i32>) -> Self
pub fn set_num_retries(self, input: Option<i32>) -> Self
The maximum number of retries for Kinesis Data Streams API requests. The default value is 3
.
Sourcepub fn get_num_retries(&self) -> &Option<i32>
pub fn get_num_retries(&self) -> &Option<i32>
The maximum number of retries for Kinesis Data Streams API requests. The default value is 3
.
Sourcepub fn retry_interval_ms(self, input: i64) -> Self
pub fn retry_interval_ms(self, input: i64) -> Self
The cool-off time period (specified in ms) before retrying the Kinesis Data Streams API call. The default value is 1000
.
Sourcepub fn set_retry_interval_ms(self, input: Option<i64>) -> Self
pub fn set_retry_interval_ms(self, input: Option<i64>) -> Self
The cool-off time period (specified in ms) before retrying the Kinesis Data Streams API call. The default value is 1000
.
Sourcepub fn get_retry_interval_ms(&self) -> &Option<i64>
pub fn get_retry_interval_ms(&self) -> &Option<i64>
The cool-off time period (specified in ms) before retrying the Kinesis Data Streams API call. The default value is 1000
.
Sourcepub fn max_retry_interval_ms(self, input: i64) -> Self
pub fn max_retry_interval_ms(self, input: i64) -> Self
The maximum cool-off time period (specified in ms) between two retries of a Kinesis Data Streams API call. The default value is 10000
.
Sourcepub fn set_max_retry_interval_ms(self, input: Option<i64>) -> Self
pub fn set_max_retry_interval_ms(self, input: Option<i64>) -> Self
The maximum cool-off time period (specified in ms) between two retries of a Kinesis Data Streams API call. The default value is 10000
.
Sourcepub fn get_max_retry_interval_ms(&self) -> &Option<i64>
pub fn get_max_retry_interval_ms(&self) -> &Option<i64>
The maximum cool-off time period (specified in ms) between two retries of a Kinesis Data Streams API call. The default value is 10000
.
Sourcepub fn avoid_empty_batches(self, input: bool) -> Self
pub fn avoid_empty_batches(self, input: bool) -> Self
Avoids creating an empty microbatch job by checking for unread data in the Kinesis data stream before the batch is started. The default value is "False"
.
Sourcepub fn set_avoid_empty_batches(self, input: Option<bool>) -> Self
pub fn set_avoid_empty_batches(self, input: Option<bool>) -> Self
Avoids creating an empty microbatch job by checking for unread data in the Kinesis data stream before the batch is started. The default value is "False"
.
Sourcepub fn get_avoid_empty_batches(&self) -> &Option<bool>
pub fn get_avoid_empty_batches(&self) -> &Option<bool>
Avoids creating an empty microbatch job by checking for unread data in the Kinesis data stream before the batch is started. The default value is "False"
.
Sourcepub fn stream_arn(self, input: impl Into<String>) -> Self
pub fn stream_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the Kinesis data stream.
Sourcepub fn set_stream_arn(self, input: Option<String>) -> Self
pub fn set_stream_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the Kinesis data stream.
Sourcepub fn get_stream_arn(&self) -> &Option<String>
pub fn get_stream_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the Kinesis data stream.
Sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the role to assume using AWS Security Token Service (AWS STS). This role must have permissions for describe or read record operations for the Kinesis data stream. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSSessionName"
.
Sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the role to assume using AWS Security Token Service (AWS STS). This role must have permissions for describe or read record operations for the Kinesis data stream. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSSessionName"
.
Sourcepub fn get_role_arn(&self) -> &Option<String>
pub fn get_role_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the role to assume using AWS Security Token Service (AWS STS). This role must have permissions for describe or read record operations for the Kinesis data stream. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSSessionName"
.
Sourcepub fn role_session_name(self, input: impl Into<String>) -> Self
pub fn role_session_name(self, input: impl Into<String>) -> Self
An identifier for the session assuming the role using AWS STS. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSRoleARN"
.
Sourcepub fn set_role_session_name(self, input: Option<String>) -> Self
pub fn set_role_session_name(self, input: Option<String>) -> Self
An identifier for the session assuming the role using AWS STS. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSRoleARN"
.
Sourcepub fn get_role_session_name(&self) -> &Option<String>
pub fn get_role_session_name(&self) -> &Option<String>
An identifier for the session assuming the role using AWS STS. You must use this parameter when accessing a data stream in a different account. Used in conjunction with "awsSTSRoleARN"
.
Sourcepub fn add_record_timestamp(self, input: impl Into<String>) -> Self
pub fn add_record_timestamp(self, input: impl Into<String>) -> Self
When this option is set to 'true', the data output will contain an additional column named "__src_timestamp" that indicates the time when the corresponding record received by the stream. The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn set_add_record_timestamp(self, input: Option<String>) -> Self
pub fn set_add_record_timestamp(self, input: Option<String>) -> Self
When this option is set to 'true', the data output will contain an additional column named "__src_timestamp" that indicates the time when the corresponding record received by the stream. The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn get_add_record_timestamp(&self) -> &Option<String>
pub fn get_add_record_timestamp(&self) -> &Option<String>
When this option is set to 'true', the data output will contain an additional column named "__src_timestamp" that indicates the time when the corresponding record received by the stream. The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn emit_consumer_lag_metrics(self, input: impl Into<String>) -> Self
pub fn emit_consumer_lag_metrics(self, input: impl Into<String>) -> Self
When this option is set to 'true', for each batch, it will emit the metrics for the duration between the oldest record received by the stream and the time it arrives in Glue to CloudWatch. The metric's name is "glue.driver.streaming.maxConsumerLagInMs". The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn set_emit_consumer_lag_metrics(self, input: Option<String>) -> Self
pub fn set_emit_consumer_lag_metrics(self, input: Option<String>) -> Self
When this option is set to 'true', for each batch, it will emit the metrics for the duration between the oldest record received by the stream and the time it arrives in Glue to CloudWatch. The metric's name is "glue.driver.streaming.maxConsumerLagInMs". The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn get_emit_consumer_lag_metrics(&self) -> &Option<String>
pub fn get_emit_consumer_lag_metrics(&self) -> &Option<String>
When this option is set to 'true', for each batch, it will emit the metrics for the duration between the oldest record received by the stream and the time it arrives in Glue to CloudWatch. The metric's name is "glue.driver.streaming.maxConsumerLagInMs". The default value is 'false'. This option is supported in Glue version 4.0 or later.
Sourcepub fn starting_timestamp(self, input: DateTime) -> Self
pub fn starting_timestamp(self, input: DateTime) -> Self
The timestamp of the record in the Kinesis data stream to start reading data from. The possible values are a timestamp string in UTC format of the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00+08:00").
Sourcepub fn set_starting_timestamp(self, input: Option<DateTime>) -> Self
pub fn set_starting_timestamp(self, input: Option<DateTime>) -> Self
The timestamp of the record in the Kinesis data stream to start reading data from. The possible values are a timestamp string in UTC format of the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00+08:00").
Sourcepub fn get_starting_timestamp(&self) -> &Option<DateTime>
pub fn get_starting_timestamp(&self) -> &Option<DateTime>
The timestamp of the record in the Kinesis data stream to start reading data from. The possible values are a timestamp string in UTC format of the pattern yyyy-mm-ddTHH:MM:SSZ
(where Z represents a UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00+08:00").
Sourcepub fn build(self) -> KinesisStreamingSourceOptions
pub fn build(self) -> KinesisStreamingSourceOptions
Consumes the builder and constructs a KinesisStreamingSourceOptions
.
Trait Implementations§
Source§impl Clone for KinesisStreamingSourceOptionsBuilder
impl Clone for KinesisStreamingSourceOptionsBuilder
Source§fn clone(&self) -> KinesisStreamingSourceOptionsBuilder
fn clone(&self) -> KinesisStreamingSourceOptionsBuilder
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 KinesisStreamingSourceOptionsBuilder
impl Default for KinesisStreamingSourceOptionsBuilder
Source§fn default() -> KinesisStreamingSourceOptionsBuilder
fn default() -> KinesisStreamingSourceOptionsBuilder
Source§impl PartialEq for KinesisStreamingSourceOptionsBuilder
impl PartialEq for KinesisStreamingSourceOptionsBuilder
Source§fn eq(&self, other: &KinesisStreamingSourceOptionsBuilder) -> bool
fn eq(&self, other: &KinesisStreamingSourceOptionsBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for KinesisStreamingSourceOptionsBuilder
Auto Trait Implementations§
impl Freeze for KinesisStreamingSourceOptionsBuilder
impl RefUnwindSafe for KinesisStreamingSourceOptionsBuilder
impl Send for KinesisStreamingSourceOptionsBuilder
impl Sync for KinesisStreamingSourceOptionsBuilder
impl Unpin for KinesisStreamingSourceOptionsBuilder
impl UnwindSafe for KinesisStreamingSourceOptionsBuilder
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);