pub struct Editor { /* private fields */ }Expand description
Editing a program: see the module docs.
Implementations§
Source§impl Editor
impl Editor
Sourcepub fn new(registry: Registry, files: impl FileStoreMut + 'static) -> Self
pub fn new(registry: Registry, files: impl FileStoreMut + 'static) -> Self
An editor of what registry offers, editing a program of no steps,
the files it places parts from read from files, what they are made
into kept in memory.
Sourcepub fn with_cache(
registry: Registry,
files: impl FileStoreMut + 'static,
cache: Cache,
) -> Self
pub fn with_cache( registry: Registry, files: impl FileStoreMut + 'static, cache: Cache, ) -> Self
Editor::new, what its files are made into kept in cache: a
host process’s, kept on disk too.
pub fn program(&self) -> &Program
Sourcepub fn forget_viewer(&mut self)
pub fn forget_viewer(&mut self)
Forgets what the viewer was sent: the next update sends all of the
scene, as to a viewer that has nothing — one starting afresh, or one
that never saw the updates someone else asked for (see
crate::agent::Session::new).
Sourcepub fn counts(&self) -> Counts
pub fn counts(&self) -> Counts
How much work its runs have done: what a test bounds an edit by.
Sourcepub fn editing(&self) -> Option<&ProgramStep>
pub fn editing(&self) -> Option<&ProgramStep>
The step being edited, with its arguments as they now are.
Sourcepub fn step_editor(&self) -> Option<&StepEditor>
pub fn step_editor(&self) -> Option<&StepEditor>
The step editor of the step being edited: its operation’s editing state among what it keeps.
Sourcepub fn handle_json(&mut self, command: &str) -> Result<String, String>
pub fn handle_json(&mut self, command: &str) -> Result<String, String>
Editor::handle on the wire: command is a Command as JSON,
and the answer an Update as JSON. Shared by every front end that
is not Rust (the browser’s wasm module, the VS Code host process),
so they all speak the same protocol. Err is a message that is not
itself an update: the command could not be read, or the update not
written.