pub struct Editor { /* private fields */ }
Expand description
An interactive console-based text editor.
The text editor owns the textual contents it is editing.
Trait Implementations§
Source§impl Program for Editor
impl Program for Editor
Source§fn is_dirty(&self) -> bool
fn is_dirty(&self) -> bool
Returns true if the program was modified since it was last saved (as indicated by a call to
set_name
).Source§fn edit<'life0, 'life1, 'async_trait>(
&'life0 mut self,
console: &'life1 mut dyn Console,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn edit<'life0, 'life1, 'async_trait>(
&'life0 mut self,
console: &'life1 mut dyn Console,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Edits the program interactively via the given
console
.Source§fn load(&mut self, name: Option<&str>, text: &str)
fn load(&mut self, name: Option<&str>, text: &str)
Reloads the contents of the stored program with the given
text
and tracks them as coming
from the file given in name
.Auto Trait Implementations§
impl Freeze for Editor
impl RefUnwindSafe for Editor
impl Send for Editor
impl Sync for Editor
impl Unpin 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