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]

fn end_byte(&self) -> usize

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

fn end_char(&self) -> usize

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

fn byte_range(self) -> Range<usize>

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

fn char_range(self) -> Range<usize>

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

Trait Implementations

impl PartialEq for Info
[src]

fn eq(&self, __arg_0: &Info) -> bool

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

fn ne(&self, __arg_0: &Info) -> bool

This method tests for !=.

impl Debug for Info
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Info
[src]

fn clone(&self) -> Info

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for Info
[src]