Struct nannou::ui::prelude::text::line::Info [−][src]
pub struct Info { pub start_byte: usize, pub start_char: usize, pub end_break: Break, pub width: f64, }
Expand description
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 Rect
s, 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.
Implementations
The index range for indexing (via bytes) into the original str slice.
The index range for indexing into a char
iterator over the original str slice.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Info
impl UnwindSafe for Info
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more
pub fn vzip(self) -> V