pub struct Repl {
pub env: Env,
pub transcript: Vec<String>,
/* private fields */
}Expand description
REPL state. Owns the persistent Env and the running transcript so
:save can replay the session.
Fields§
§env: Env§transcript: Vec<String>Implementations§
Source§impl Repl
impl Repl
pub fn new(env_options: EnvOptions, cwd: Option<PathBuf>) -> Self
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the env to a fresh copy of the original options and clear the transcript.
Sourcepub fn evaluate_source(
&mut self,
source: &str,
file: Option<&str>,
) -> (String, String)
pub fn evaluate_source( &mut self, source: &str, file: Option<&str>, ) -> (String, String)
Evaluate a chunk of LiNo source against the persistent env.
Sourcepub fn feed(&mut self, line: &str) -> ReplStep
pub fn feed(&mut self, line: &str) -> ReplStep
Process a single REPL line (LiNo form or meta-command).
Sourcepub fn completion_candidates(&self, prefix: &str) -> Vec<String>
pub fn completion_candidates(&self, prefix: &str) -> Vec<String>
Best-effort tab-completion candidates for prefix. Returns names
from the env (terms, ops, symbols, lambdas), built-in keywords, and
meta-commands when prefix starts with :.
Auto Trait Implementations§
impl Freeze for Repl
impl RefUnwindSafe for Repl
impl Send for Repl
impl Sync for Repl
impl Unpin for Repl
impl UnsafeUnpin for Repl
impl UnwindSafe for Repl
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