pub struct ParagraphMetrics {
pub total_height: f32,
pub total_width: f32,
pub line_count: usize,
pub overflow: bool,
pub truncated: bool,
}Expand description
Aggregate metrics for a whole laid-out block of text.
Fields§
§total_height: f32Total height of all lines stacked vertically, in pixels.
total_width: f32Width of the widest line, in pixels.
line_count: usizeNumber of lines produced.
overflow: booltrue if any line’s natural width exceeded max_width and could not
be broken (e.g. a single unbreakable token wider than the column).
truncated: booltrue if the last line was truncated with an ellipsis because it
exceeded TruncationMode::max_width.
Trait Implementations§
Source§impl Clone for ParagraphMetrics
impl Clone for ParagraphMetrics
Source§fn clone(&self) -> ParagraphMetrics
fn clone(&self) -> ParagraphMetrics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParagraphMetrics
impl Debug for ParagraphMetrics
Source§impl PartialEq for ParagraphMetrics
impl PartialEq for ParagraphMetrics
Source§fn eq(&self, other: &ParagraphMetrics) -> bool
fn eq(&self, other: &ParagraphMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ParagraphMetrics
impl StructuralPartialEq for ParagraphMetrics
Auto Trait Implementations§
impl Freeze for ParagraphMetrics
impl RefUnwindSafe for ParagraphMetrics
impl Send for ParagraphMetrics
impl Sync for ParagraphMetrics
impl Unpin for ParagraphMetrics
impl UnsafeUnpin for ParagraphMetrics
impl UnwindSafe for ParagraphMetrics
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more