Struct egui::text_selection::text_cursor_state::TextCursorState
source · pub struct TextCursorState {
cursor_range: Option<CursorRange>,
ccursor_range: Option<CCursorRange>,
}
Expand description
The state of a text cursor selection.
Used for crate::TextEdit
and crate::Label
.
Fields§
§cursor_range: Option<CursorRange>
§ccursor_range: Option<CCursorRange>
This is what is easiest to work with when editing text, so users are more likely to read/write this.
Implementations§
source§impl TextCursorState
impl TextCursorState
pub fn is_empty(&self) -> bool
sourcepub fn char_range(&self) -> Option<CCursorRange>
pub fn char_range(&self) -> Option<CCursorRange>
The currently selected range of characters.
pub fn range(&self, galley: &Galley) -> Option<CursorRange>
sourcepub fn set_char_range(&mut self, ccursor_range: Option<CCursorRange>)
pub fn set_char_range(&mut self, ccursor_range: Option<CCursorRange>)
Sets the currently selected range of characters.
pub fn set_range(&mut self, cursor_range: Option<CursorRange>)
Trait Implementations§
source§impl Clone for TextCursorState
impl Clone for TextCursorState
source§fn clone(&self) -> TextCursorState
fn clone(&self) -> TextCursorState
Returns a copy 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 moresource§impl Debug for TextCursorState
impl Debug for TextCursorState
source§impl Default for TextCursorState
impl Default for TextCursorState
source§fn default() -> TextCursorState
fn default() -> TextCursorState
Returns the “default value” for a type. Read more
source§impl From<CCursorRange> for TextCursorState
impl From<CCursorRange> for TextCursorState
source§fn from(ccursor_range: CCursorRange) -> Self
fn from(ccursor_range: CCursorRange) -> Self
Converts to this type from the input type.
source§impl From<CursorRange> for TextCursorState
impl From<CursorRange> for TextCursorState
source§fn from(cursor_range: CursorRange) -> Self
fn from(cursor_range: CursorRange) -> Self
Converts to this type from the input type.
impl Copy for TextCursorState
Auto Trait Implementations§
impl Freeze for TextCursorState
impl RefUnwindSafe for TextCursorState
impl Send for TextCursorState
impl Sync for TextCursorState
impl Unpin for TextCursorState
impl UnwindSafe for TextCursorState
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)