[][src]Crate term_string

Provide a string and a style type for terminal formatted output.

This crate wraps around the term crate. And thus, supports both Terminfo terminals, and the Windows console.

Examples

// color is a re-exported module from term
use term_string::color::{GREEN, RED};

use term_string::{TermString, TermStyle};

// Create term styles
let style1 = TermStyle::bold() + TermStyle::fg(GREEN) + TermStyle::bg(RED);
let style2 = TermStyle::underline(true);

// Create term string from a style and a string value
let mut ts = TermString::new(style1, "style");

// "1" inherits style1
ts+= "1";

// " : " is un-styled
ts += TermString::from(" : ");

ts += TermString::new(style2, "This is text with style 2");

ts.println();

Check TermStyle and TermString for detailed documentation of each type.

Re-exports

pub extern crate isatty;
pub extern crate term;

Modules

color

Terminal color definitions

Structs

TermString

A string type with term styling info attached to it.

TermStyle

Styling info for TermString.

Enums

Attr

Terminal attributes for use with term.attr().

Traits

TermWrite