pub struct Selection { /* private fields */ }Expand description
Directional selection with anchor and head (caret position).
Implementations§
Source§impl Selection
impl Selection
pub const fn new(anchor: usize, head: usize) -> Self
pub const fn cursor(offset: usize) -> Self
pub const fn anchor(&self) -> usize
pub const fn head(&self) -> usize
Sourcepub fn range(&self) -> TextRange
pub fn range(&self) -> TextRange
Return the normalized range (start <= end) covered by this selection.
pub fn is_cursor(&self) -> bool
pub fn is_forward(&self) -> bool
Trait Implementations§
impl Copy for Selection
impl Eq for Selection
impl StructuralPartialEq for Selection
Auto Trait Implementations§
impl Freeze for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnsafeUnpin 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