pub struct Styled<'a> { /* private fields */ }Expand description
スタイル付きテキストのビルダー。
style 関数で生成し、メソッドチェーンで装飾を追加する。
Display で ANSI エスケープ付き文字列を出力する。
§例
use neco_tui::{style, Color};
let s = style("error").fg(Color::Red).bold();
// Display で "\x1b[31;1merror\x1b[0m" を出力
let output = s.to_string();
assert!(output.contains("error"));
assert!(output.ends_with("\x1b[0m"));Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Styled<'a>
impl<'a> RefUnwindSafe for Styled<'a>
impl<'a> Send for Styled<'a>
impl<'a> Sync for Styled<'a>
impl<'a> Unpin for Styled<'a>
impl<'a> UnsafeUnpin for Styled<'a>
impl<'a> UnwindSafe for Styled<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more