[−][src]Struct pretty_assertions::Style
A style is a collection of properties that can format a string using ANSI escape codes.
Fields
foreground: Option<Colour>
The style's foreground colour, if it has one.
background: Option<Colour>
The style's background colour, if it has one.
is_bold: bool
Whether this style is bold.
is_dimmed: bool
Whether this style is dimmed.
is_italic: bool
Whether this style is italic.
is_underline: bool
Whether this style is underlined.
is_blink: bool
Whether this style is blinking.
is_reverse: bool
Whether this style has reverse colours.
Whether this style is hidden.
is_strikethrough: bool
Whether this style is struckthrough.
Methods
impl Style
[src][−]
pub fn prefix(self) -> Prefix
[src][+]
pub fn infix(self, other: Style) -> Infix
[src][+]
pub fn suffix(self) -> Suffix
[src][+]
impl Style
[src][−]
pub fn new() -> Style
[src][+]
pub fn bold(&self) -> Style
[src][+]
pub fn dimmed(&self) -> Style
[src][+]
pub fn italic(&self) -> Style
[src][+]
pub fn underline(&self) -> Style
[src][+]
pub fn blink(&self) -> Style
[src][+]
pub fn reverse(&self) -> Style
[src][+]
[src][+]
pub fn strikethrough(&self) -> Style
[src][+]
pub fn fg(&self, foreground: Colour) -> Style
[src][+]
pub fn on(&self, background: Colour) -> Style
[src][+]
pub fn is_plain(self) -> bool
[src][+]
impl Style
[src][−]
pub fn paint<'a, I, S>(self, input: I) -> ANSIGenericString<'a, S> where
I: Into<Cow<'a, S>>,
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
[src][+]
I: Into<Cow<'a, S>>,
S: 'a + ToOwned + ?Sized,
<S as ToOwned>::Owned: Debug,
Trait Implementations
impl Debug for Style
[src][+]
impl Copy for Style
[src]
impl Clone for Style
[src][+]
impl From<Colour> for Style
[src][+]
impl Default for Style
[src][+]
impl PartialEq<Style> for Style
[src][+]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src][+]
impl<T, U> Into for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T> Borrow for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,