pub struct TextEditor;Expand description
Text editing utilities
Implementations§
Source§impl TextEditor
impl TextEditor
Sourcepub fn kill_line_backward(
text: &str,
cursor_pos: usize,
) -> Option<(String, String)>
pub fn kill_line_backward( text: &str, cursor_pos: usize, ) -> Option<(String, String)>
Kill text from beginning of line to cursor position
Returns (killed_text, remaining_text)
Sourcepub fn kill_line_forward(
text: &str,
cursor_pos: usize,
) -> Option<(String, String)>
pub fn kill_line_forward( text: &str, cursor_pos: usize, ) -> Option<(String, String)>
Kill text from cursor position to end of line
Returns (killed_text, remaining_text)
Auto Trait Implementations§
impl Freeze for TextEditor
impl RefUnwindSafe for TextEditor
impl Send for TextEditor
impl Sync for TextEditor
impl Unpin for TextEditor
impl UnsafeUnpin for TextEditor
impl UnwindSafe for TextEditor
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> 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 more