pub struct Line { /* private fields */ }Expand description
One line of output: its pieces, in order.
Implementations§
Source§impl Line
impl Line
pub fn new() -> Self
pub fn single(role: Role, text: impl Into<String>) -> Self
Sourcepub fn hit(m: &Match, rest: Role) -> Self
pub fn hit(m: &Match, rest: Role) -> Self
A match’s source line split around the hit, leading indentation
dropped: the text before, the hit, the text after. The text around the
hit takes rest.
Sourcepub fn counts(counts: &[(Mark, usize)]) -> Self
pub fn counts(counts: &[(Mark, usize)]) -> Self
✓ 3 ? 1 ✗ 0: each mark’s glyph and count, pairs two spaces apart.
Sourcepub fn and(self, role: Role, text: impl Into<String>) -> Self
pub fn and(self, role: Role, text: impl Into<String>) -> Self
Add a piece; the line, for chaining.
Sourcepub fn and_line(self, other: Line) -> Self
pub fn and_line(self, other: Line) -> Self
Append another line’s pieces; the line, for chaining.
pub fn pieces(&self) -> &[Piece]
pub fn is_empty(&self) -> bool
Trait Implementations§
impl Eq for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnsafeUnpin for Line
impl UnwindSafe for Line
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,
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