pub struct Info {
pub start_byte: usize,
pub start_char: usize,
pub end_break: Break,
pub width: Scalar,
pub height: Scalar,
}
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 into the &str
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.
height: Scalar
The greatest height of all characters yielded.
Implementations§
Trait Implementations§
source§impl PartialEq for Info
impl PartialEq for Info
impl Copy for Info
impl StructuralPartialEq for Info
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§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more