Enum comfy_table::Attribute [−][src]
pub enum Attribute {
Show variants
Reset,
Bold,
Dim,
Italic,
Underlined,
SlowBlink,
RapidBlink,
Reverse,
Hidden,
CrossedOut,
Fraktur,
NoBold,
NormalIntensity,
NoItalic,
NoUnderline,
NoBlink,
NoReverse,
NoHidden,
NotCrossedOut,
Framed,
Encircled,
OverLined,
NotFramedOrEncircled,
NotOverLined,
}Expand description
Attributes used for styling cell content. Reexport of crossterm’s Attributes enum. Represents an attribute.
Platform-specific Notes
- Only UNIX and Windows 10 terminals do support text attributes.
- Keep in mind that not all terminals support all attributes.
- Crossterm implements almost all attributes listed in the SGR parameters.
| Attribute | Windows | UNIX | Notes |
|---|---|---|---|
Reset | ✓ | ✓ | |
Bold | ✓ | ✓ | |
Dim | ✓ | ✓ | |
Italic | ? | ? | Not widely supported, sometimes treated as inverse. |
Underlined | ✓ | ✓ | |
SlowBlink | ? | ? | Not widely supported, sometimes treated as inverse. |
RapidBlink | ? | ? | Not widely supported. MS-DOS ANSI.SYS; 150+ per minute. |
Reverse | ✓ | ✓ | |
Hidden | ✓ | ✓ | Also known as Conceal. |
Fraktur | ✗ | ✓ | Legible characters, but marked for deletion. |
DefaultForegroundColor | ? | ? | Implementation specific (according to standard). |
DefaultBackgroundColor | ? | ? | Implementation specific (according to standard). |
Framed | ? | ? | Not widely supported. |
Encircled | ? | ? | This should turn on the encircled attribute. |
OverLined | ? | ? | This should draw a line at the top of the text. |
Examples
Basic usage:
use crossterm::style::Attribute; println!( "{} Underlined {} No Underline", Attribute::Underlined, Attribute::NoUnderline );
Style existing text:
use crossterm::style::Stylize; println!("{}", "Bold text".bold()); println!("{}", "Underlined text".underlined()); println!("{}", "Negative text".negative());
Variants
Resets all the attributes.
Increases the text intensity.
Decreases the text intensity.
Emphasises the text.
Underlines the text.
Makes the text blinking (< 150 per minute).
Makes the text blinking (>= 150 per minute).
Swaps foreground and background colors.
Hides the text (also known as Conceal).
Crosses the text.
Sets the Fraktur typeface.
Mostly used for mathematical alphanumeric symbols.
Turns off the Bold attribute. - Inconsistent - Prefer to use NormalIntensity
Switches the text back to normal intensity (no bold, italic).
Turns off the Italic attribute.
Turns off the Underlined attribute.
Turns off the text blinking (SlowBlink or RapidBlink).
Turns off the Reverse attribute.
Turns off the Hidden attribute.
Turns off the CrossedOut attribute.
Makes the text framed.
Makes the text encircled.
Draws a line at the top of the text.
Turns off the Frame and Encircled attributes.
Turns off the OverLined attribute.
Implementations
Attributes used for styling cell content. Reexport of crossterm’s Attributes enum.
Returns a u32 with one bit set, which is the signature of this attribute in the Attributes bitset.
The +1 enables storing Reset (whose index is 0) in the bitset Attributes.
Attributes used for styling cell content. Reexport of crossterm’s Attributes enum.
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Attributeimpl UnwindSafe for AttributeBlanket Implementations
Mutably borrows from an owned value. Read more