pub struct Selection {
pub anchor: ByteOffset,
pub head: ByteOffset,
pub goal: Option<VisualCol>,
}Fields§
§anchor: ByteOffset§head: ByteOffset§goal: Option<VisualCol>Remembered visual column for consecutive vertical movement.
Implementations§
Source§impl Selection
impl Selection
pub fn caret(pos: ByteOffset) -> Self
pub fn new(anchor: ByteOffset, head: ByteOffset) -> Self
pub fn with_goal(self, goal: Option<VisualCol>) -> Self
pub fn start(&self) -> ByteOffset
pub fn end(&self) -> ByteOffset
pub fn range(&self) -> Range<ByteOffset> ⓘ
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Selection
impl<'de> Deserialize<'de> for Selection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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