pub struct Cursor {
pub x: usize,
pub y: usize,
/* private fields */
}
Expand description
Represents a movable point within a document.
Fields§
§x: usize
The column offset of this cursor, starting at 0.
y: usize
The line offset of this cursor, starting at 0.
Implementations§
Trait Implementations§
source§impl Adjustable for Cursor
impl Adjustable for Cursor
source§fn adjust(&mut self, adjs: &[CursorAdjustment])
fn adjust(&mut self, adjs: &[CursorAdjustment])
Apply a CursorAdjustment to any applicable cursors.
source§impl CursorMovements<Cursor> for EditRope
impl CursorMovements<Cursor> for EditRope
source§fn range_of_movement(
&self,
cursor: &Cursor,
movement: &MoveType,
count: &Count,
ctx: &CursorMovementsContext<'_, Cursor>
) -> Option<EditRange<Cursor>>
fn range_of_movement( &self, cursor: &Cursor, movement: &MoveType, count: &Count, ctx: &CursorMovementsContext<'_, Cursor> ) -> Option<EditRange<Cursor>>
Given an action’s movement, calculate the affected range base on the cursor’s current position.
source§fn first_word(
&self,
cursor: &Cursor,
_: &CursorMovementsContext<'_, Cursor>
) -> Cursor
fn first_word( &self, cursor: &Cursor, _: &CursorMovementsContext<'_, Cursor> ) -> Cursor
Calculate the position of the first word on the line of the provided cursor.
source§impl CursorSearch<Cursor> for EditRope
impl CursorSearch<Cursor> for EditRope
source§fn find_char(
&self,
cursor: &Cursor,
inclusive: bool,
dir: MoveDir1D,
multiline: bool,
needle: char,
count: usize
) -> Option<Cursor>
fn find_char( &self, cursor: &Cursor, inclusive: bool, dir: MoveDir1D, multiline: bool, needle: char, count: usize ) -> Option<Cursor>
Search for a specific character.
source§impl From<Cursor> for CursorChoice
impl From<Cursor> for CursorChoice
source§impl From<Cursor> for CursorState
impl From<Cursor> for CursorState
source§impl Ord for Cursor
impl Ord for Cursor
source§impl PartialEq for Cursor
impl PartialEq for Cursor
source§impl PartialOrd for Cursor
impl PartialOrd for Cursor
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.