pub struct PrintLine<'a> { /* private fields */ }Expand description
A Line, drawn on the first row of the area it’s rendered into and
clipped to area.width() columns. Only the first row is used.
align defaults to Align::Left (drawn at the left edge); set it with
PrintLine::align to right-align or center the whole line’s spans as a
unit within area.width() columns.
§Examples
use retroglyph_core::backend::Headless;
use retroglyph_core::text::Line;
use retroglyph_core::terminal::Terminal;
use retroglyph_ui::{PrintLine, Widget};
let mut term = Terminal::new(Headless::new(20, 1));
let line = Line::raw("hello");
term.draw(|surface| {
PrintLine::new(&line).render(surface);
})
.unwrap();Implementations§
Trait Implementations§
impl<'a> Copy for PrintLine<'a>
Auto Trait Implementations§
impl<'a> Freeze for PrintLine<'a>
impl<'a> RefUnwindSafe for PrintLine<'a>
impl<'a> Send for PrintLine<'a>
impl<'a> Sync for PrintLine<'a>
impl<'a> Unpin for PrintLine<'a>
impl<'a> UnsafeUnpin for PrintLine<'a>
impl<'a> UnwindSafe for PrintLine<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
Wraps
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
Wraps
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).