pub struct Repl {
pub commands: Vec<Command>,
pub items: Vec<Vec<String>>,
pub statements: Vec<Vec<String>>,
pub name: &'static str,
pub prompt_colour: Color,
pub out_colour: Color,
/* private fields */
}
Expand description
A REPL instance.
Fields
commands: Vec<Command>
The REPL handled commands. Can be extended.
ⓘ
let repl = Repl::new();
repl.commands.push(Command::new("load", CmdArgs::Filename, "load and evaluate file contents as inputs", |r, arg_text| {
r.run_file(arg_text);
}));
items: Vec<Vec<String>>
Items compiled into every program. These are functions, types, etc.
statements: Vec<Vec<String>>
Blocks of statements applied in order.
name: &'static str
App and prompt text.
prompt_colour: Color
The colour of the prompt region. ie papyrus
.
out_colour: Color
The colour of the out component. ie [out0]
.
Implementations
sourceimpl Repl
impl Repl
sourcepub fn with_prompt(prompt: &'static str) -> Self
pub fn with_prompt(prompt: &'static str) -> Self
Auto Trait Implementations
impl RefUnwindSafe for Repl
impl Send for Repl
impl Sync for Repl
impl Unpin for Repl
impl UnwindSafe for Repl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more