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

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

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: f64

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.

pub fn byte_range(self) -> Range<usize>[src]

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

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 Clone for Info[src]

impl Copy for Info[src]

impl Debug for Info[src]

impl PartialEq<Info> for Info[src]

impl StructuralPartialEq for Info[src]

Auto Trait Implementations

impl RefUnwindSafe for Info

impl Send for Info

impl Sync for Info

impl Unpin for Info

impl UnwindSafe for Info

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,