pub struct Selection {
pub anchor: Position,
pub head: Position,
}Expand description
A range of text with a fixed anchor and a moving head.
The head is where the cursor is drawn and where typing happens. Extending moves the head and leaves the anchor, which is what makes shift+arrow grow and shrink from the end the user expects.
Fields§
§anchor: Position§head: PositionImplementations§
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