pub struct WordAtCaret {
pub word: String,
pub trailing: String,
pub chars_before_caret: usize,
pub chars_after_caret: usize,
}Expand description
The word at (or immediately to the left of) the caret, with the
metadata an emit-side replace needs to delete the right characters
before retyping. Returned by Buffer::word_at_caret.
Fields§
§word: StringThe full word — both halves around the caret if the caret sits inside the word.
trailing: StringWhitespace between the right edge of the word and the caret when the caret is in trailing whitespace, otherwise empty.
chars_before_caret: usizeHow many characters of word sit BEFORE the caret. Emit
uses this as the BackSpace count.
chars_after_caret: usizeHow many characters of word sit AFTER the caret. Emit
uses this as the Delete-key count.
Trait Implementations§
Source§impl Clone for WordAtCaret
impl Clone for WordAtCaret
Source§fn clone(&self) -> WordAtCaret
fn clone(&self) -> WordAtCaret
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WordAtCaret
impl Debug for WordAtCaret
impl Eq for WordAtCaret
Source§impl PartialEq for WordAtCaret
impl PartialEq for WordAtCaret
Source§fn eq(&self, other: &WordAtCaret) -> bool
fn eq(&self, other: &WordAtCaret) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WordAtCaret
Auto Trait Implementations§
impl Freeze for WordAtCaret
impl RefUnwindSafe for WordAtCaret
impl Send for WordAtCaret
impl Sync for WordAtCaret
impl Unpin for WordAtCaret
impl UnsafeUnpin for WordAtCaret
impl UnwindSafe for WordAtCaret
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.