pub struct TextElement {
pub content: String,
pub style: TextStyle,
pub wrap: TextWrap,
}Expand description
A styled text element.
use a3s_tui::element::TextElement;
use a3s_tui::style::Color;
let text = TextElement::new("Hello, world!")
.bold()
.fg(Color::Cyan);Fields§
§content: String§style: TextStyle§wrap: TextWrapImplementations§
Source§impl TextElement
impl TextElement
pub fn new(content: impl Into<String>) -> Self
pub fn fg(self, c: Color) -> Self
pub fn bg(self, c: Color) -> Self
pub fn bold(self) -> Self
pub fn italic(self) -> Self
pub fn underline(self) -> Self
pub fn reverse(self) -> Self
pub fn dim(self) -> Self
pub fn strikethrough(self) -> Self
pub fn wrap(self, w: TextWrap) -> Self
Auto Trait Implementations§
impl Freeze for TextElement
impl RefUnwindSafe for TextElement
impl Send for TextElement
impl Sync for TextElement
impl Unpin for TextElement
impl UnsafeUnpin for TextElement
impl UnwindSafe for TextElement
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