pub struct RichText { /* private fields */ }Expand description
Rich text widget for displaying formatted content.
Implementations§
Source§impl RichText
impl RichText
Sourcepub fn new(elements: impl Into<Vec<RichTextElement>>) -> Self
pub fn new(elements: impl Into<Vec<RichTextElement>>) -> Self
Creates a new RichText widget from the provided elements.
Sourcepub fn from_markdown(markdown: &str) -> Self
pub fn from_markdown(markdown: &str) -> Self
Parses a Markdown document into a RichText tree.
Sourcepub fn elements(&self) -> &[RichTextElement]
pub fn elements(&self) -> &[RichTextElement]
Returns the rich text elements for inspection or testing.
Trait Implementations§
Source§impl FromIterator<RichTextElement> for RichText
impl FromIterator<RichTextElement> for RichText
Source§fn from_iter<T: IntoIterator<Item = RichTextElement>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RichTextElement>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for RichText
impl !RefUnwindSafe for RichText
impl !Send for RichText
impl !Sync for RichText
impl Unpin for RichText
impl !UnwindSafe for RichText
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IdentifiableExt for T
impl<T> IdentifiableExt for T
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<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
fn metadata<T: MetadataKey>(self, metadata: T) -> Metadata<T>
Attaches metadata to a view. Read more
Source§fn with<T: 'static>(self, value: T) -> With<Self, T>
fn with<T: 'static>(self, value: T) -> With<Self, T>
Associates a value with this view in the environment.
Source§fn title(self, title: impl Into<Text>) -> NavigationView
fn title(self, title: impl Into<Text>) -> NavigationView
Sets this view as the content of a navigation view with the specified title. Read more
Source§fn focused<T: 'static + Eq + Clone>(
self,
value: &Binding<Option<T>>,
equals: T,
) -> Metadata<Focused>
fn focused<T: 'static + Eq + Clone>( self, value: &Binding<Option<T>>, equals: T, ) -> Metadata<Focused>
Marks this view as focused when the binding matches the specified value. Read more
Source§fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
fn on_change<C, F>(self, source: &C, handler: F) -> OnChange<Self, C::Guard>
Monitors a signal for changes and triggers a handler when the signal’s value changes. Read more
Source§fn task<Fut>(self, task: Fut) -> Metadata<Retain>
fn task<Fut>(self, task: Fut) -> Metadata<Retain>
Spawns an asynchronous task tied to the lifecycle of this view. Read more
Source§fn background(self, background: impl Into<Background>) -> Metadata<Background>
fn background(self, background: impl Into<Background>) -> Metadata<Background>
Sets the background of this view. Read more
Source§fn foreground(
self,
color: impl IntoComputed<Color>,
) -> Metadata<ForegroundColor>
fn foreground( self, color: impl IntoComputed<Color>, ) -> Metadata<ForegroundColor>
Sets the foreground color of this view. Read more
Source§fn event<H: 'static>(
self,
event: Event,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn event<H: 'static>( self, event: Event, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds an event handler for the specified event. Read more
Source§fn on_disappear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_disappear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view disappears. Read more
Source§fn on_appear<H: 'static>(
self,
handler: impl HandlerFnOnce<H, ()> + 'static,
) -> Metadata<OnEvent>
fn on_appear<H: 'static>( self, handler: impl HandlerFnOnce<H, ()> + 'static, ) -> Metadata<OnEvent>
Adds a handler that triggers when the view appears. Read more
Source§fn min_height(self, height: f32) -> Frame
fn min_height(self, height: f32) -> Frame
Applies a minimum height constraint.
Source§fn max_height(self, height: f32) -> Frame
fn max_height(self, height: f32) -> Frame
Applies a maximum height constraint.
Source§fn alignment(self, alignment: Alignment) -> Frame
fn alignment(self, alignment: Alignment) -> Frame
Aligns this view within its frame using the provided alignment.
Source§fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
fn padding_with(self, edge: impl Into<EdgeInsets>) -> Padding
Adds padding to this view with custom edge insets. Read more
Source§fn tag<T>(self, tag: T) -> TaggedView<T, Self>
fn tag<T>(self, tag: T) -> TaggedView<T, Self>
Tags this view with a custom tag for identification. Read more
Source§fn a11y_label(
self,
label: impl Into<Str>,
) -> IgnorableMetadata<AccessibilityLabel>
fn a11y_label( self, label: impl Into<Str>, ) -> IgnorableMetadata<AccessibilityLabel>
Sets the accessibility label for this view. Read more
Source§fn a11y_role(
self,
role: AccessibilityRole,
) -> IgnorableMetadata<AccessibilityRole>
fn a11y_role( self, role: AccessibilityRole, ) -> IgnorableMetadata<AccessibilityRole>
Sets the accessibility role for this view. Read more
Source§fn gesture<P: 'static>(
self,
gesture: impl Into<Gesture>,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn gesture<P: 'static>( self, gesture: impl Into<Gesture>, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Observes a gesture and executes an action when the gesture is recognized. Read more
Source§fn on_tap<P: 'static>(
self,
action: impl HandlerFn<P, ()> + 'static,
) -> Metadata<GestureObserver>
fn on_tap<P: 'static>( self, action: impl HandlerFn<P, ()> + 'static, ) -> Metadata<GestureObserver>
Adds a tap gesture recognizer to this view that triggers the specified action. Read more
Source§fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
fn shadow(self, shadow: impl Into<Shadow>) -> Metadata<Shadow>
Applies a shadow effect to this view.
Source§fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
fn ignore_safe_area(self, edges: EdgeSet) -> Metadata<IgnoreSafeArea>
Extends this view’s bounds to ignore safe area insets on the specified edges. Read more