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::{Rect, Terminal};
use retroglyph_widgets::{PrintLine, Widget};
let mut term = Terminal::new(Headless::new(20, 1));
let line = Line::raw("hello");
term.draw(|surface| {
PrintLine::new(&line).render(Rect::new(0, 0, 20, 1), 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