pub trait Program {
    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§

Returns true if the program was modified since it was last saved (as indicated by a call to set_name).

Edits the program interactively via the given console.

Reloads the contents of the stored program with the given text and tracks them as coming from the file given in name.

Path of the loaded program. Should be None if the program has never been saved yet.

Resets the name of the program. Used when saving it.

Gets the contents of the stored program as a single string.

Implementors§