pub struct Selection {
pub anchor: u64,
pub focus: u64,
}Expand description
Where a selection was begun and where it was carried to, as byte offsets of one version; collapsed when the two are the same offset.
Fields§
§anchor: u64§focus: u64Implementations§
Source§impl Selection
impl Selection
Sourcepub fn mapped(self, transaction: &Transaction) -> Selection
pub fn mapped(self, transaction: &Transaction) -> Selection
Where this selection stands in the version transaction makes.
An offset before an edit stays put, an insertion at the offset itself included; one after it moves by what the edit added and removed; one inside a replaced span moves to the end of what replaced it, because the bytes it pointed into are gone.
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