pub struct LineInfo {
pub start_byte: usize,
pub start_char: usize,
pub end_break: Break,
pub width: f32,
}Expand description
Information about a single line of text within a &str.
Info is a minimal amount of information that can be stored for efficient reasoning about
blocks of text given some &str. The start and end_break can be used for indexing into
the &str, and the width can be used for calculating line Rects, alignment, etc.
Fields§
§start_byte: usizeThe index into the &str that represents the first character within the line.
start_char: usizeThe character index of the first character in the line.
end_break: BreakThe index within the &str at which this line breaks into a new line, along with the
index at which the following line begins. The variant describes whether the break is
caused by a Newline character or a Wrap by the given wrap function.
width: f32The total width of all characters within the line.
Implementations§
Trait Implementations§
impl Copy for LineInfo
impl StructuralPartialEq for LineInfo
Auto Trait Implementations§
impl Freeze for LineInfo
impl RefUnwindSafe for LineInfo
impl Send for LineInfo
impl Sync for LineInfo
impl Unpin for LineInfo
impl UnwindSafe for LineInfo
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