#[non_exhaustive]pub struct RichText {
pub root_id: WidgetId,
pub caret: RichCaretInfo,
/* private fields */
}Expand description
Represents the rich text context.
Use TEXT to get.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root_id: WidgetIdWidget that defines the rich text context.
caret: RichCaretInfoWidgets that define the caret and selection indexes.
Implementations§
Source§impl RichText
impl RichText
Sourcepub fn root_info(&self) -> Option<WidgetInfo>
pub fn root_info(&self) -> Option<WidgetInfo>
Get root widget info.
See also RichTextWidgetInfoExt to query the
Sourcepub fn leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static
pub fn leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the text/leaf component descendants that can be interacted with.
Sourcepub fn leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
pub fn leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the text/leaf component descendants that can be interacted with in reverse.
Sourcepub fn selection(&self) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static
pub fn selection(&self) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static
Iterate over all text/leaf components that are part of the selection.
The return iterator is empty if there is no selection.
Sourcepub fn selection_rev(
&self,
) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static
pub fn selection_rev( &self, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static
Iterate over all text/leaf components that are part of the selection in reverse.
The return iterator is empty if there is no selection.
Sourcepub fn caret_index_info(&self) -> Option<WidgetInfo>
pub fn caret_index_info(&self) -> Option<WidgetInfo>
Gets the caret.index widget info if it is set and is a valid leaf.
Sourcepub fn caret_selection_index_info(&self) -> Option<WidgetInfo>
pub fn caret_selection_index_info(&self) -> Option<WidgetInfo>
Gets the caret.selection_index widget info if it is set and is a valid leaf.
Sourcepub fn leaf_info(&self, id: WidgetId) -> Option<WidgetInfo>
pub fn leaf_info(&self, id: WidgetId) -> Option<WidgetInfo>
Gets the id widget info if it is a valid leaf in the rich text context.
Source§impl RichText
impl RichText
Sourcepub fn notify_leaf(&self, update: EventUpdate)
pub fn notify_leaf(&self, update: EventUpdate)
Send an event immediately to a leaf widget inside the rich context.
After the current event returns to the rich text root widget the update is sent. Rich text leaves can send
multiple commands to sibling leaves to implement rich text operations, using this method instead of the global dispatch
can gain significant performance.
Note that all requests during a single app event run after that event, and all recursive requests during these notification events only run after they all notify, that is, not actually recursive.
§Panics
Panics is not called during a UiNode::event.
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§
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
§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>
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>
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