#[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.
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