Module text_style::ansi_term[][src]

Expand description

Conversion methods for ansi_term’s text style types.

Requires the ansi_term feature.

This module implements these conversions:

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.