pub struct Span {
pub content: String,
pub style: Style,
}Expand description
A string with an associated Style.
The building block of styled terminal output. A Line is composed of
one or more Spans, each with its own style.
§Examples
use retroglyph::text::Span;
use retroglyph::style::Style;
use retroglyph::color::Color;
let plain = Span::raw("hello");
let colored = Span::styled("world", Style::new().fg(Color::GREEN));Fields§
§content: StringThe text content.
style: StyleThe style applied to this span.
Implementations§
Trait Implementations§
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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