pub struct Selection { /* private fields */ }
Expand description
Represents the current text selection state.
A selection is defined by an origin point (where selection started) and an end point
(where selection currently ends). The selection can span multiple lines, with each
line’s visual boundaries stored in the lines
vector.
Implementations§
Source§impl Selection
impl Selection
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if there is no active selection.
A selection is considered empty if either the origin or end cursor is not set.
§Examples
use protextinator::Selection;
let selection = Selection::default();
assert!(selection.is_empty());
Sourcepub fn lines(&self) -> &[SelectionLine]
pub fn lines(&self) -> &[SelectionLine]
Returns the visual selection lines for rendering.
Each line represents a portion of the selection with its visual boundaries.
§Returns
A slice of SelectionLine
objects representing the visual selection
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnwindSafe for Selection
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