pub struct Editor { /* private fields */ }Implementations§
Source§impl Editor
impl Editor
pub fn new() -> Self
pub fn with_content(content: String) -> Self
pub fn content(&self) -> &str
pub fn cursor(&self) -> usize
pub fn scroll_offset(&self) -> usize
pub fn visual_cursor(&self) -> usize
pub fn insert_char(&mut self, c: char)
pub fn delete_back(&mut self)
pub fn delete_forward(&mut self)
pub fn move_left(&mut self)
pub fn move_right(&mut self)
pub fn move_home(&mut self)
pub fn move_end(&mut self)
pub fn update_scroll(&mut self, visible_width: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Editor
impl RefUnwindSafe for Editor
impl Send for Editor
impl Sync for Editor
impl Unpin for Editor
impl UnsafeUnpin for Editor
impl UnwindSafe for Editor
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> 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