Struct termstyle::Text
[−]
[src]
pub struct Text { /* fields omitted */ }
A piece of text, may be colored, etc
Methods
impl Text
[src]
fn new(t: String) -> Text
[src]
Instantiate the Text as just plain text.
Use the builder pattern to construct the rest.
Examples
use termstyle::{Color, Text}; let t = Text::new("bold and blue text".into()) .bold() .color(Color::Blue); // write it to stdout t.paint(&mut ::std::io::stdout()).unwrap();
fn bold(self) -> Text
[src]
Make the text styled as bold
fn italic(self) -> Text
[src]
Make the text styled as italic
fn color(self, color: Color) -> Text
[src]
Set the color style of the text
fn paint<W: Write>(&self, w: &mut W) -> Result<()>
[src]
fn is_bold(&self) -> bool
[src]
fn is_italic(&self) -> bool
[src]
fn is_plain(&self) -> bool
[src]
fn get_color(&self) -> Color
[src]
fn set_plain(&mut self)
[src]
Clears all formatting.
Trait Implementations
impl Debug for Text
[src]
impl Default for Text
[src]
impl Eq for Text
[src]
impl PartialEq for Text
[src]
fn eq(&self, __arg_0: &Text) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Text) -> bool
[src]
This method tests for !=
.