Struct nannou::ui::text::line::Info[][src]

pub struct Info {
    pub start_byte: usize,
    pub start_char: usize,
    pub end_break: Break,
    pub width: f64,
}

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

The index into the &str that represents the first character within the line.

The character index of the first character in the line.

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.

The total width of all characters within the line.

Methods

impl Info
[src]

The end of the byte index range for indexing into the slice.

The end of the index range for indexing into the slice.

Important traits for Range<A>

The index range for indexing (via bytes) into the original str slice.

Important traits for Range<A>

The index range for indexing into a char iterator over the original str slice.

Trait Implementations

impl Clone for Info
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Info
[src]

Formats the value using the given formatter. Read more

impl Copy for Info
[src]

impl PartialEq<Info> for Info
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for Info

impl Sync for Info