pub struct ReplSession<'i, H> { /* private fields */ }Expand description
A persistent REPL session against an Interpreter<H>.
Multiple calls to eval_str share the same global env — bindings
introduced by one call are visible to subsequent calls. Errors in one
call do not poison the session.
Implementations§
Source§impl<'i, H: 'static> ReplSession<'i, H>
impl<'i, H: 'static> ReplSession<'i, H>
pub fn new(interp: &'i mut Interpreter<H>) -> Self
Sourcepub fn eval_str(&mut self, input: &str, host: &mut H) -> Result<Value>
pub fn eval_str(&mut self, input: &str, host: &mut H) -> Result<Value>
Evaluate one or more forms from input in the session’s env,
returning the value of the last form. Phase 2.5 fills this in.
Sourcepub fn is_complete(input: &str) -> bool
pub fn is_complete(input: &str) -> bool
Paren-balance check — returns true when input is a complete set
of top-level forms (ready to submit) or false when the user’s
client should keep collecting more input.
Phase 2.2: minimal heuristic (open-paren count vs close-paren count, ignoring string literals). Phase 2.5 refines.
Auto Trait Implementations§
impl<'i, H> !RefUnwindSafe for ReplSession<'i, H>
impl<'i, H> !UnwindSafe for ReplSession<'i, H>
impl<'i, H> Freeze for ReplSession<'i, H>
impl<'i, H> Send for ReplSession<'i, H>
impl<'i, H> Sync for ReplSession<'i, H>
impl<'i, H> Unpin for ReplSession<'i, H>
impl<'i, H> UnsafeUnpin for ReplSession<'i, H>
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