#[non_exhaustive]pub struct RichCaretInfo {
pub index: Option<WidgetId>,
pub selection_index: Option<WidgetId>,
}Expand description
Represents the caret position in a RichText context.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.index: Option<WidgetId>Widget that defines the caret insert position.
Inside the widget the CaretInfo::index defines the actual index.
selection_index: Option<WidgetId>Widget that defines the selection second index.
Inside the widget the CaretInfo::selection_index defines the actual index.
Implementations§
Source§impl RichCaretInfo
impl RichCaretInfo
Sourcepub fn update_selection(
&mut self,
new_index: &WidgetInfo,
new_selection_index: Option<&WidgetInfo>,
skip_end_points: bool,
skip_focus: bool,
)
pub fn update_selection( &mut self, new_index: &WidgetInfo, new_selection_index: Option<&WidgetInfo>, skip_end_points: bool, skip_focus: bool, )
Update the rich selection and local selection for each rich component.
Before calling this you must update the CaretInfo::index in new_index and the CaretInfo::selection_index in
new_selection_index. Alternatively enable skip_end_points to handle the local selection at the end point widgets.
If you don’t want focus to be moved to the new_index set skip_focus to true.
§Panics
Panics if new_index or new_selection_index is not inside the same rich text context.
Trait Implementations§
Source§impl Clone for RichCaretInfo
impl Clone for RichCaretInfo
Source§fn clone(&self) -> RichCaretInfo
fn clone(&self) -> RichCaretInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RichCaretInfo
impl RefUnwindSafe for RichCaretInfo
impl Send for RichCaretInfo
impl Sync for RichCaretInfo
impl Unpin for RichCaretInfo
impl UnwindSafe for RichCaretInfo
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,
Source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for 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>
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