pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub fn new( prompt: &'static str, handler: impl FnMut(&mut Editor, &str) + Send + 'static, ) -> Self
pub fn prompt(&self) -> &str
pub fn rope(&self) -> &Rope
Sourcepub fn content(&self) -> RopeSlice<'_>
pub fn content(&self) -> RopeSlice<'_>
The prompt’s content, without the Text invariant’s trailing newline.
pub fn cursor(&self) -> Cursor<'_>
pub fn cursor_move(&mut self) -> CursorMove<'_>
pub fn cursor_edit(&mut self) -> CursorEdit<'_>
pub fn assert_invariants(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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