pub trait Program {
// Required methods
fn is_dirty(&self) -> bool;
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 load(&mut self, name: Option<&str>, text: &str);
fn name(&self) -> Option<&str>;
fn set_name(&mut self, name: &str);
fn text(&self) -> String;
}
Expand description
Representation of the single program that we can keep in memory.
Required Methods§
Sourcefn 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
).
Sourcefn 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
.
Sourcefn 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
.