[−][src]Module text_style::crossterm
Conversion methods for crossterm
’s text style types.
Requires the crossterm
feature.
This module implements these conversions:
Color
tocrossterm::style::Color
Effect
tocrossterm::style::Attribute
Effects
tocrossterm::style::Attributes
Style
tocrossterm::style::ContentStyle
StyledStr
andStyledString
tocrossterm::style::StyledContent
It also provides the render
and render_iter
methods to render strings and iterators
over strings.
Examples
Rendering a single string:
let s = text_style::StyledStr::plain("test").bold(); text_style::crossterm::render(std::io::stdout(), s) .expect("Failed to render string");
Rendering multiple strings:
let v = vec![ text_style::StyledStr::plain("test").bold(), text_style::StyledStr::plain(" "), text_style::StyledStr::plain("test2").italic(), ]; text_style::crossterm::render_iter(std::io::stdout(), v.iter()) .expect("Failed to render string");
Functions
render | Renders a styled string to the given output using |
render_iter | Renders multiple styled string to the given output using |