pub struct RichText { /* private fields */ }Expand description
A paragraph of mixed-style text: a sequence of TextRuns (bold, italic, coloured links) shaped and
wrapped as one, the multi-style counterpart of Text. The shared paragraph metrics — font
size, line height, wrapping, max_lines — come from a base TextStyle; each run overrides only weight,
slant, and colour.
Implementations§
Source§impl RichText
impl RichText
Sourcepub fn auto(
runs_fn: impl Fn() -> Vec<TextRun> + 'static,
layout_style: LayoutStyle,
base_fn: impl Fn() -> TextStyle + 'static,
) -> Result<Self, LayoutError>
pub fn auto( runs_fn: impl Fn() -> Vec<TextRun> + 'static, layout_style: LayoutStyle, base_fn: impl Fn() -> TextStyle + 'static, ) -> Result<Self, LayoutError>
A rich paragraph whose leaf height is measured from its runs at the resolved width, so the box grows to
fit however many lines they wrap into and pushes following siblings down — like [Text::auto].
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RichText
impl !Send for RichText
impl !Sync for RichText
impl !UnwindSafe for RichText
impl Freeze for RichText
impl Unpin for RichText
impl UnsafeUnpin for RichText
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
impl<T> LayoutItem for Twhere
T: LeafWidget + Component,
fn layout_node(&self) -> NodeId
Source§fn pointer_opaque(&self) -> bool
fn pointer_opaque(&self) -> bool
Whether this widget stands in front of whatever its siblings drew underneath it, for a pointer event
its parent is hit-testing. Read more