Struct conrod::text::line::Info
[−]
[src]
pub struct Info {
pub start_byte: usize,
pub start_char: usize,
pub end_break: Break,
pub width: Scalar,
}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: usize
The index into the &str that represents the first character within the line.
start_char: usize
The character index of the first character in the line.
end_break: Break
The 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: Scalar
The total width of all characters within the line.
Methods
impl Info[src]
pub fn end_byte(&self) -> usize[src]
The end of the byte index range for indexing into the slice.
pub fn end_char(&self) -> usize[src]
The end of the index range for indexing into the slice.
ⓘImportant traits for Range<A>pub fn byte_range(self) -> Range<usize>[src]
The index range for indexing (via bytes) into the original str slice.
ⓘImportant traits for Range<A>pub fn char_range(self) -> Range<usize>[src]
The index range for indexing into a char iterator over the original str slice.
Trait Implementations
impl Copy for Info[src]
impl Clone for Info[src]
fn clone(&self) -> Info[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Info[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more