pub struct RowBuilder { /* private fields */ }Expand description
Incrementally wraps input text into visual rows of at most width cells.
Step 1: plain-text only. ANSI-carry and styled spans will be added later.
Implementations§
Source§impl RowBuilder
impl RowBuilder
pub fn new(target_width: usize) -> Self
pub fn width(&self) -> usize
pub fn set_width(&mut self, width: usize)
Sourcepub fn push_fragment(&mut self, fragment: &str)
pub fn push_fragment(&mut self, fragment: &str)
Push an input fragment. May contain newlines.
Sourcepub fn end_line(&mut self)
pub fn end_line(&mut self)
Mark the end of the current logical line (equivalent to pushing a ‘\n’).
Sourcepub fn display_rows(&self) -> Vec<Row>
pub fn display_rows(&self) -> Vec<Row>
Rows suitable for display, including the current partial line if any.
Sourcepub fn drain_commit_ready(&mut self, max_keep: usize) -> Vec<Row>
pub fn drain_commit_ready(&mut self, max_keep: usize) -> Vec<Row>
Drain the oldest rows that exceed max_keep display rows (including the
current partial line, if any). Returns the drained rows in order.
Auto Trait Implementations§
impl Freeze for RowBuilder
impl RefUnwindSafe for RowBuilder
impl Send for RowBuilder
impl Sync for RowBuilder
impl Unpin for RowBuilder
impl UnsafeUnpin for RowBuilder
impl UnwindSafe for RowBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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