pub struct LinePrinter { /* private fields */ }Expand description
use to print a single line, properly handle the tabstop and shift of a string
e.g. a long line will be printed as ..some content or some content.. or ..some content..
depends on the container’s width and the size of the content.
let's say we have a very long line with lots of useless information
|.. with lots of use..| // only to show this
|<- container width ->|
|<- shift -> |
|< hscroll >|Implementations§
Source§impl LinePrinter
impl LinePrinter
pub fn builder() -> Self
pub fn row(self, row: usize) -> Self
pub fn col(self, col: usize) -> Self
pub fn tabstop(self, tabstop: usize) -> Self
pub fn hscroll_offset(self, offset: i64) -> Self
pub fn text_width(self, width: usize) -> Self
pub fn container_width(self, width: usize) -> Self
pub fn shift(self, shift: usize) -> Self
pub fn build(self) -> Self
pub fn reset(&mut self)
pub fn print_char( &mut self, canvas: &mut dyn Canvas, ch: char, attr: Attr, skip: bool, )
Auto Trait Implementations§
impl Freeze for LinePrinter
impl RefUnwindSafe for LinePrinter
impl Send for LinePrinter
impl Sync for LinePrinter
impl Unpin for LinePrinter
impl UnsafeUnpin for LinePrinter
impl UnwindSafe for LinePrinter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more