#[non_exhaustive]pub struct PresetWatermarkBuilder { /* private fields */ }
Expand description
A builder for PresetWatermark
.
Implementations§
source§impl PresetWatermarkBuilder
impl PresetWatermarkBuilder
sourcepub fn id(self, input: impl Into<String>) -> Self
pub fn id(self, input: impl Into<String>) -> Self
A unique identifier for the settings for one watermark. The value of Id
can be up to 40 characters long.
sourcepub fn set_id(self, input: Option<String>) -> Self
pub fn set_id(self, input: Option<String>) -> Self
A unique identifier for the settings for one watermark. The value of Id
can be up to 40 characters long.
sourcepub fn get_id(&self) -> &Option<String>
pub fn get_id(&self) -> &Option<String>
A unique identifier for the settings for one watermark. The value of Id
can be up to 40 characters long.
sourcepub fn max_width(self, input: impl Into<String>) -> Self
pub fn max_width(self, input: impl Into<String>) -> Self
The maximum width of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxWidth
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.If you specify the value in pixels, it must be less than or equal to the value of
MaxWidth
.
sourcepub fn set_max_width(self, input: Option<String>) -> Self
pub fn set_max_width(self, input: Option<String>) -> Self
The maximum width of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxWidth
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.If you specify the value in pixels, it must be less than or equal to the value of
MaxWidth
.
sourcepub fn get_max_width(&self) -> &Option<String>
pub fn get_max_width(&self) -> &Option<String>
The maximum width of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxWidth
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.If you specify the value in pixels, it must be less than or equal to the value of
MaxWidth
.
sourcepub fn max_height(self, input: impl Into<String>) -> Self
pub fn max_height(self, input: impl Into<String>) -> Self
The maximum height of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.
If you specify the value in pixels, it must be less than or equal to the value of MaxHeight
.
sourcepub fn set_max_height(self, input: Option<String>) -> Self
pub fn set_max_height(self, input: Option<String>) -> Self
The maximum height of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.
If you specify the value in pixels, it must be less than or equal to the value of MaxHeight
.
sourcepub fn get_max_height(&self) -> &Option<String>
pub fn get_max_height(&self) -> &Option<String>
The maximum height of the watermark in one of the following formats:
-
number of pixels (px): The minimum value is 16 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100. Use the value of
Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the calculation.
If you specify the value in pixels, it must be less than or equal to the value of MaxHeight
.
sourcepub fn sizing_policy(self, input: impl Into<String>) -> Self
pub fn sizing_policy(self, input: impl Into<String>) -> Self
A value that controls scaling of the watermark:
-
Fit: Elastic Transcoder scales the watermark so it matches the value that you specified in either
MaxWidth
orMaxHeight
without exceeding the other value. -
Stretch: Elastic Transcoder stretches the watermark to match the values that you specified for
MaxWidth
andMaxHeight
. If the relative proportions of the watermark and the values ofMaxWidth
andMaxHeight
are different, the watermark will be distorted. -
ShrinkToFit: Elastic Transcoder scales the watermark down so that its dimensions match the values that you specified for at least one of
MaxWidth
andMaxHeight
without exceeding either value. If you specify this option, Elastic Transcoder does not scale the watermark up.
sourcepub fn set_sizing_policy(self, input: Option<String>) -> Self
pub fn set_sizing_policy(self, input: Option<String>) -> Self
A value that controls scaling of the watermark:
-
Fit: Elastic Transcoder scales the watermark so it matches the value that you specified in either
MaxWidth
orMaxHeight
without exceeding the other value. -
Stretch: Elastic Transcoder stretches the watermark to match the values that you specified for
MaxWidth
andMaxHeight
. If the relative proportions of the watermark and the values ofMaxWidth
andMaxHeight
are different, the watermark will be distorted. -
ShrinkToFit: Elastic Transcoder scales the watermark down so that its dimensions match the values that you specified for at least one of
MaxWidth
andMaxHeight
without exceeding either value. If you specify this option, Elastic Transcoder does not scale the watermark up.
sourcepub fn get_sizing_policy(&self) -> &Option<String>
pub fn get_sizing_policy(&self) -> &Option<String>
A value that controls scaling of the watermark:
-
Fit: Elastic Transcoder scales the watermark so it matches the value that you specified in either
MaxWidth
orMaxHeight
without exceeding the other value. -
Stretch: Elastic Transcoder stretches the watermark to match the values that you specified for
MaxWidth
andMaxHeight
. If the relative proportions of the watermark and the values ofMaxWidth
andMaxHeight
are different, the watermark will be distorted. -
ShrinkToFit: Elastic Transcoder scales the watermark down so that its dimensions match the values that you specified for at least one of
MaxWidth
andMaxHeight
without exceeding either value. If you specify this option, Elastic Transcoder does not scale the watermark up.
sourcepub fn horizontal_align(self, input: impl Into<String>) -> Self
pub fn horizontal_align(self, input: impl Into<String>) -> Self
The horizontal position of the watermark unless you specify a non-zero value for HorizontalOffset
:
-
Left: The left edge of the watermark is aligned with the left border of the video.
-
Right: The right edge of the watermark is aligned with the right border of the video.
-
Center: The watermark is centered between the left and right borders.
sourcepub fn set_horizontal_align(self, input: Option<String>) -> Self
pub fn set_horizontal_align(self, input: Option<String>) -> Self
The horizontal position of the watermark unless you specify a non-zero value for HorizontalOffset
:
-
Left: The left edge of the watermark is aligned with the left border of the video.
-
Right: The right edge of the watermark is aligned with the right border of the video.
-
Center: The watermark is centered between the left and right borders.
sourcepub fn get_horizontal_align(&self) -> &Option<String>
pub fn get_horizontal_align(&self) -> &Option<String>
The horizontal position of the watermark unless you specify a non-zero value for HorizontalOffset
:
-
Left: The left edge of the watermark is aligned with the left border of the video.
-
Right: The right edge of the watermark is aligned with the right border of the video.
-
Center: The watermark is centered between the left and right borders.
sourcepub fn horizontal_offset(self, input: impl Into<String>) -> Self
pub fn horizontal_offset(self, input: impl Into<String>) -> Self
The amount by which you want the horizontal position of the watermark to be offset from the position specified by HorizontalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of MaxWidth.
-
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Left for HorizontalAlign
and 5px for HorizontalOffset
, the left side of the watermark appears 5 pixels from the left border of the output video.
HorizontalOffset
is only valid when the value of HorizontalAlign
is Left
or Right
. If you specify an offset that causes the watermark to extend beyond the left or right border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn set_horizontal_offset(self, input: Option<String>) -> Self
pub fn set_horizontal_offset(self, input: Option<String>) -> Self
The amount by which you want the horizontal position of the watermark to be offset from the position specified by HorizontalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of MaxWidth.
-
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Left for HorizontalAlign
and 5px for HorizontalOffset
, the left side of the watermark appears 5 pixels from the left border of the output video.
HorizontalOffset
is only valid when the value of HorizontalAlign
is Left
or Right
. If you specify an offset that causes the watermark to extend beyond the left or right border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn get_horizontal_offset(&self) -> &Option<String>
pub fn get_horizontal_offset(&self) -> &Option<String>
The amount by which you want the horizontal position of the watermark to be offset from the position specified by HorizontalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of MaxWidth.
-
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Left for HorizontalAlign
and 5px for HorizontalOffset
, the left side of the watermark appears 5 pixels from the left border of the output video.
HorizontalOffset
is only valid when the value of HorizontalAlign
is Left
or Right
. If you specify an offset that causes the watermark to extend beyond the left or right border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn vertical_align(self, input: impl Into<String>) -> Self
pub fn vertical_align(self, input: impl Into<String>) -> Self
The vertical position of the watermark unless you specify a non-zero value for VerticalOffset
:
-
Top: The top edge of the watermark is aligned with the top border of the video.
-
Bottom: The bottom edge of the watermark is aligned with the bottom border of the video.
-
Center: The watermark is centered between the top and bottom borders.
sourcepub fn set_vertical_align(self, input: Option<String>) -> Self
pub fn set_vertical_align(self, input: Option<String>) -> Self
The vertical position of the watermark unless you specify a non-zero value for VerticalOffset
:
-
Top: The top edge of the watermark is aligned with the top border of the video.
-
Bottom: The bottom edge of the watermark is aligned with the bottom border of the video.
-
Center: The watermark is centered between the top and bottom borders.
sourcepub fn get_vertical_align(&self) -> &Option<String>
pub fn get_vertical_align(&self) -> &Option<String>
The vertical position of the watermark unless you specify a non-zero value for VerticalOffset
:
-
Top: The top edge of the watermark is aligned with the top border of the video.
-
Bottom: The bottom edge of the watermark is aligned with the bottom border of the video.
-
Center: The watermark is centered between the top and bottom borders.
sourcepub fn vertical_offset(self, input: impl Into<String>) -> Self
pub fn vertical_offset(self, input: impl Into<String>) -> Self
VerticalOffset
The amount by which you want the vertical position of the watermark to be offset from the position specified by VerticalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Top
for VerticalAlign
and 5px
for VerticalOffset
, the top of the watermark appears 5 pixels from the top border of the output video.
VerticalOffset
is only valid when the value of VerticalAlign is Top or Bottom.
If you specify an offset that causes the watermark to extend beyond the top or bottom border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn set_vertical_offset(self, input: Option<String>) -> Self
pub fn set_vertical_offset(self, input: Option<String>) -> Self
VerticalOffset
The amount by which you want the vertical position of the watermark to be offset from the position specified by VerticalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Top
for VerticalAlign
and 5px
for VerticalOffset
, the top of the watermark appears 5 pixels from the top border of the output video.
VerticalOffset
is only valid when the value of VerticalAlign is Top or Bottom.
If you specify an offset that causes the watermark to extend beyond the top or bottom border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn get_vertical_offset(&self) -> &Option<String>
pub fn get_vertical_offset(&self) -> &Option<String>
VerticalOffset
The amount by which you want the vertical position of the watermark to be offset from the position specified by VerticalAlign:
-
number of pixels (px): The minimum value is 0 pixels, and the maximum value is the value of
MaxHeight
. -
integer percentage (%): The range of valid values is 0 to 100.
For example, if you specify Top
for VerticalAlign
and 5px
for VerticalOffset
, the top of the watermark appears 5 pixels from the top border of the output video.
VerticalOffset
is only valid when the value of VerticalAlign is Top or Bottom.
If you specify an offset that causes the watermark to extend beyond the top or bottom border and Elastic Transcoder has not added black bars, the watermark is cropped. If Elastic Transcoder has added black bars, the watermark extends into the black bars. If the watermark extends beyond the black bars, it is cropped.
Use the value of Target
to specify whether you want Elastic Transcoder to include the black bars that are added by Elastic Transcoder, if any, in the offset calculation.
sourcepub fn opacity(self, input: impl Into<String>) -> Self
pub fn opacity(self, input: impl Into<String>) -> Self
A percentage that indicates how much you want a watermark to obscure the video in the location where it appears. Valid values are 0 (the watermark is invisible) to 100 (the watermark completely obscures the video in the specified location). The datatype of Opacity
is float.
Elastic Transcoder supports transparent .png graphics. If you use a transparent .png, the transparent portion of the video appears as if you had specified a value of 0 for Opacity
. The .jpg file format doesn't support transparency.
sourcepub fn set_opacity(self, input: Option<String>) -> Self
pub fn set_opacity(self, input: Option<String>) -> Self
A percentage that indicates how much you want a watermark to obscure the video in the location where it appears. Valid values are 0 (the watermark is invisible) to 100 (the watermark completely obscures the video in the specified location). The datatype of Opacity
is float.
Elastic Transcoder supports transparent .png graphics. If you use a transparent .png, the transparent portion of the video appears as if you had specified a value of 0 for Opacity
. The .jpg file format doesn't support transparency.
sourcepub fn get_opacity(&self) -> &Option<String>
pub fn get_opacity(&self) -> &Option<String>
A percentage that indicates how much you want a watermark to obscure the video in the location where it appears. Valid values are 0 (the watermark is invisible) to 100 (the watermark completely obscures the video in the specified location). The datatype of Opacity
is float.
Elastic Transcoder supports transparent .png graphics. If you use a transparent .png, the transparent portion of the video appears as if you had specified a value of 0 for Opacity
. The .jpg file format doesn't support transparency.
sourcepub fn target(self, input: impl Into<String>) -> Self
pub fn target(self, input: impl Into<String>) -> Self
A value that determines how Elastic Transcoder interprets values that you specified for HorizontalOffset
, VerticalOffset
, MaxWidth
, and MaxHeight
:
-
Content:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. -
Frame:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any.
sourcepub fn set_target(self, input: Option<String>) -> Self
pub fn set_target(self, input: Option<String>) -> Self
A value that determines how Elastic Transcoder interprets values that you specified for HorizontalOffset
, VerticalOffset
, MaxWidth
, and MaxHeight
:
-
Content:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. -
Frame:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any.
sourcepub fn get_target(&self) -> &Option<String>
pub fn get_target(&self) -> &Option<String>
A value that determines how Elastic Transcoder interprets values that you specified for HorizontalOffset
, VerticalOffset
, MaxWidth
, and MaxHeight
:
-
Content:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video excluding black bars added by Elastic Transcoder, if any. -
Frame:
HorizontalOffset
andVerticalOffset
values are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any. In addition,MaxWidth
andMaxHeight
, if specified as a percentage, are calculated based on the borders of the video including black bars added by Elastic Transcoder, if any.
sourcepub fn build(self) -> PresetWatermark
pub fn build(self) -> PresetWatermark
Consumes the builder and constructs a PresetWatermark
.
Trait Implementations§
source§impl Clone for PresetWatermarkBuilder
impl Clone for PresetWatermarkBuilder
source§fn clone(&self) -> PresetWatermarkBuilder
fn clone(&self) -> PresetWatermarkBuilder
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PresetWatermarkBuilder
impl Debug for PresetWatermarkBuilder
source§impl Default for PresetWatermarkBuilder
impl Default for PresetWatermarkBuilder
source§fn default() -> PresetWatermarkBuilder
fn default() -> PresetWatermarkBuilder
source§impl PartialEq for PresetWatermarkBuilder
impl PartialEq for PresetWatermarkBuilder
impl StructuralPartialEq for PresetWatermarkBuilder
Auto Trait Implementations§
impl Freeze for PresetWatermarkBuilder
impl RefUnwindSafe for PresetWatermarkBuilder
impl Send for PresetWatermarkBuilder
impl Sync for PresetWatermarkBuilder
impl Unpin for PresetWatermarkBuilder
impl UnwindSafe for PresetWatermarkBuilder
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
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>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
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>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
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>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
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>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
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>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
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 underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
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);