pub struct TextObject<State = Readonly> { /* private fields */ }Implementations§
Source§impl TextObject<Readonly>
impl TextObject<Readonly>
pub fn from(content: &str) -> TextObject<Readonly>
pub fn with_write(self) -> TextObject<Write>
Source§impl TextObject<Write>
impl TextObject<Write>
pub fn insert_char(&mut self, c: char, cursor: &Cursor)
pub fn insert_newline(&mut self, cursor: &Cursor)
pub fn erase_backwards_up_to_line_start(&mut self, cursor: &Cursor)
pub fn erase_previous_char(&mut self, cursor: &Cursor)
pub fn erase_current_char(&mut self, cursor: &Cursor)
pub fn current_line(&self, cursor: &Cursor) -> Option<&str>
pub fn line_len_with_linebreak(&self, line: usize) -> usize
pub fn line_len(&self, line: usize) -> usize
pub fn erase_until_eol(&mut self, cursor: &Cursor)
pub fn find_char_after_whitespace(&self, cursor: &Cursor) -> (usize, usize)
pub fn find_char_before_whitespace(&self, cursor: &Cursor) -> (usize, usize)
pub fn find_char_after_separator(&self, cursor: &Cursor) -> (usize, usize)
pub fn find_char_before_separator(&self, cursor: &Cursor) -> (usize, usize)
pub fn find_empty_line_above(&self, cursor: &Cursor) -> usize
pub fn find_empty_line_below(&self, cursor: &Cursor) -> usize
pub fn len_lines(&self) -> usize
pub fn delete_line(&mut self, line: usize)
Sourcepub fn delete_word(&mut self, cursor: &Cursor)
pub fn delete_word(&mut self, cursor: &Cursor)
deletes a word forward in one of two ways:
- if the current character is alphanumeric, then this delete up to the first non alphanumeric character
- if the current character is non alphanumeric, then delete up to the first alphanumeric character
Sourcepub fn delete_word_backwards(&mut self, cursor: &Cursor) -> usize
pub fn delete_word_backwards(&mut self, cursor: &Cursor) -> usize
deletes a word backwards in one of two ways:
- if the current character is alphanumeric, then this delete up to the first non alphanumeric character
- if the current character is non alphanumeric, then delete up to the first alphanumeric character
will always return how many columns to advance the cursor
pub fn insert_line_below(&mut self, cursor: &Cursor, tree: Option<&Tree>)
pub fn insert_line_above(&mut self, cursor: &Cursor, tree: Option<&Tree>)
pub fn find_oposing_token(&mut self, cursor: &Cursor) -> (usize, usize)
Trait Implementations§
Source§impl<State: Clone> Clone for TextObject<State>
impl<State: Clone> Clone for TextObject<State>
Source§fn clone(&self) -> TextObject<State>
fn clone(&self) -> TextObject<State>
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<State: Debug> Debug for TextObject<State>
impl<State: Debug> Debug for TextObject<State>
Source§impl<State> Default for TextObject<State>
impl<State> Default for TextObject<State>
Source§impl<State> Display for TextObject<State>
impl<State> Display for TextObject<State>
Source§impl<State: PartialEq> PartialEq for TextObject<State>
impl<State: PartialEq> PartialEq for TextObject<State>
Source§fn eq(&self, other: &TextObject<State>) -> bool
fn eq(&self, other: &TextObject<State>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<State> StructuralPartialEq for TextObject<State>
Auto Trait Implementations§
impl<State> Freeze for TextObject<State>
impl<State> RefUnwindSafe for TextObject<State>where
State: RefUnwindSafe,
impl<State> Send for TextObject<State>where
State: Send,
impl<State> Sync for TextObject<State>where
State: Sync,
impl<State> Unpin for TextObject<State>where
State: Unpin,
impl<State> UnsafeUnpin for TextObject<State>
impl<State> UnwindSafe for TextObject<State>where
State: UnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more