pub struct TextSelection { /* private fields */ }Expand description
Anchor/head text selection used by frontend integrations.
Qem keeps this selection in document coordinates so applications remain free to own their own painting, cursor visuals, and interaction model.
Implementations§
Source§impl TextSelection
impl TextSelection
Sourcepub const fn new(anchor: TextPosition, head: TextPosition) -> Self
pub const fn new(anchor: TextPosition, head: TextPosition) -> Self
Creates a selection from an anchor and active head position.
Sourcepub const fn caret(position: TextPosition) -> Self
pub const fn caret(position: TextPosition) -> Self
Creates a caret selection at a single position.
Sourcepub const fn anchor(self) -> TextPosition
pub const fn anchor(self) -> TextPosition
Returns the anchor position.
Sourcepub const fn head(self) -> TextPosition
pub const fn head(self) -> TextPosition
Returns the active head position.
Trait Implementations§
Source§impl Clone for TextSelection
impl Clone for TextSelection
Source§fn clone(&self) -> TextSelection
fn clone(&self) -> TextSelection
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 moreSource§impl Debug for TextSelection
impl Debug for TextSelection
Source§impl Default for TextSelection
impl Default for TextSelection
Source§fn default() -> TextSelection
fn default() -> TextSelection
Returns the “default value” for a type. Read more
Source§impl Hash for TextSelection
impl Hash for TextSelection
Source§impl PartialEq for TextSelection
impl PartialEq for TextSelection
impl Copy for TextSelection
impl Eq for TextSelection
impl StructuralPartialEq for TextSelection
Auto Trait Implementations§
impl Freeze for TextSelection
impl RefUnwindSafe for TextSelection
impl Send for TextSelection
impl Sync for TextSelection
impl Unpin for TextSelection
impl UnsafeUnpin for TextSelection
impl UnwindSafe for TextSelection
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