Expand description
Conversion methods for ansi_term’s text style types.
Requires the ansi_term feature.
This module implements these conversions:
Colortoansi_term::ColorStyletoansi_term::StyleStyledStrandStyledStringtoansi_term::ANSIString
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::ansi_term::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::ansi_term::render_iter(std::io::stdout(), v.iter())
.expect("Failed to render string");Functions§
- render
- Renders a styled string to the given output using
ansi_term. - render_
iter - Renders multiple styled string to the given output using
ansi_term.