pub struct Paragraph(/* private fields */);
Expand description
A bunch of text.
Implementations§
Trait Implementations§
Source§impl Paragraph for Paragraph
impl Paragraph for Paragraph
Source§fn with_text(text: Text<&str>) -> Self
fn with_text(text: Text<&str>) -> Self
Creates a new [
Paragraph
] laid out with the given [Text
].Source§fn with_spans<Link>(text: Text<&[Span<'_, Link>]>) -> Self
fn with_spans<Link>(text: Text<&[Span<'_, Link>]>) -> Self
Creates a new [
Paragraph
] laid out with the given [Text
].Source§fn compare(&self, text: Text<()>) -> Difference
fn compare(&self, text: Text<()>) -> Difference
Compares the [
Paragraph
] with some desired [Text
] and returns the
[Difference
].Source§fn line_height(&self) -> LineHeight
fn line_height(&self) -> LineHeight
Returns the [
LineHeight
] of the [Paragraph
].Source§fn min_bounds(&self) -> Size
fn min_bounds(&self) -> Size
Returns the minimum boundaries that can fit the contents of the
[
Paragraph
].Source§fn hit_test(&self, point: Point) -> Option<Hit>
fn hit_test(&self, point: Point) -> Option<Hit>
Tests whether the provided point is within the boundaries of the
[
Paragraph
], returning information about the nearest character.Source§fn hit_span(&self, point: Point) -> Option<usize>
fn hit_span(&self, point: Point) -> Option<usize>
Tests whether the provided point is within the boundaries of a
[
Span
] in the [Paragraph
], returning the index of the [Span
]
that was hit.Source§fn span_bounds(&self, index: usize) -> Vec<Rectangle>
fn span_bounds(&self, index: usize) -> Vec<Rectangle>
Returns all bounds for the provided [
Span
] index of the [Paragraph
].
A [Span
] can have multiple bounds for each line it’s on.Source§fn grapheme_position(&self, line: usize, index: usize) -> Option<Point>
fn grapheme_position(&self, line: usize, index: usize) -> Option<Point>
Returns the distance to the given grapheme index in the [
Paragraph
].§fn min_height(&self) -> f32
fn min_height(&self) -> f32
Returns the minimum height that can fit the contents of the [
Paragraph
].impl StructuralPartialEq for Paragraph
Auto Trait Implementations§
impl Freeze for Paragraph
impl RefUnwindSafe for Paragraph
impl Send for Paragraph
impl Sync for Paragraph
impl Unpin for Paragraph
impl UnwindSafe for Paragraph
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.