pub trait Paragraph: Sized + Default {
type Font: Copy + PartialEq;
// Required methods
fn with_text(text: Text<'_, Self::Font>) -> Self;
fn resize(&mut self, new_bounds: Size);
fn compare(&self, text: Text<'_, Self::Font>) -> Difference;
fn horizontal_alignment(&self) -> Horizontal;
fn vertical_alignment(&self) -> Vertical;
fn min_bounds(&self) -> Size;
fn hit_test(&self, point: Point) -> Option<Hit>;
fn grapheme_position(&self, line: usize, index: usize) -> Option<Point>;
// Provided methods
fn update(&mut self, text: Text<'_, Self::Font>) { ... }
fn min_width(&self) -> f32 { ... }
fn min_height(&self) -> f32 { ... }
}
Expand description
A text paragraph.
Required Associated Types§
Required Methods§
sourcefn compare(&self, text: Text<'_, Self::Font>) -> Difference
fn compare(&self, text: Text<'_, Self::Font>) -> Difference
Compares the Paragraph
with some desired Text
and returns the
Difference
.
sourcefn horizontal_alignment(&self) -> Horizontal
fn horizontal_alignment(&self) -> Horizontal
Returns the horizontal alignment of the Paragraph
.
sourcefn vertical_alignment(&self) -> Vertical
fn vertical_alignment(&self) -> Vertical
Returns the vertical alignment of the Paragraph
.
sourcefn min_bounds(&self) -> Size
fn min_bounds(&self) -> Size
Returns the minimum boundaries that can fit the contents of the
Paragraph
.
Provided Methods§
sourcefn min_width(&self) -> f32
fn min_width(&self) -> f32
Returns the minimum width that can fit the contents of the Paragraph
.
sourcefn min_height(&self) -> f32
fn min_height(&self) -> f32
Returns the minimum height that can fit the contents of the Paragraph
.
Object Safety§
This trait is not object safe.