[][src]Struct nannou::ui::prelude::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 Debug for Info[src]

impl PartialEq<Info> for Info[src]

impl Copy for Info[src]

impl Clone for Info[src]

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

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Info

impl Sync for Info

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Content for T[src]

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

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.