pub struct ReplSession { /* private fields */ }Expand description
A persistent imperative REPL session. See the module docs for the replay architecture.
Implementations§
Source§impl ReplSession
impl ReplSession
Sourcepub async fn eval(&mut self, input: &str) -> ReplOutcome
pub async fn eval(&mut self, input: &str) -> ReplOutcome
Evaluate one input chunk (a statement, a multi-statement chunk, or a
## definition block), returning the new output lines.
Sourcepub fn eval_sync(&mut self, input: &str) -> ReplOutcome
pub fn eval_sync(&mut self, input: &str) -> ReplOutcome
Synchronous eval for native callers.
Sourcepub fn source(&self) -> String
pub fn source(&self) -> String
The session as a complete LOGOS program: definitions first, then the Main body — always runnable as-is.
Sourcepub fn vars(&self) -> Vec<(String, String, String)>
pub fn vars(&self) -> Vec<(String, String, String)>
The session’s global bindings as (name, type, value) rows, sorted
by name. Unavailable (empty) for concurrent programs — the
inspection replay runs on the synchronous tree-walker.
NOTE: this re-executes the accumulated program (the replay
architecture) — callers that only need names for completion must use
binding_names, which never executes.
Sourcepub fn binding_names(&self) -> Vec<String>
pub fn binding_names(&self) -> Vec<String>
The names this session binds — a pure textual scan (Let <name> be,
Set <name> to, ## To <name>) with zero execution, safe to call
after every keystroke for completion feeds.
Sourcepub fn load_source(&mut self, src: &str) -> ReplOutcome
pub fn load_source(&mut self, src: &str) -> ReplOutcome
Replace the session with the contents of a saved program (the
inverse of source). Returns the program’s full
output as the outcome.
Trait Implementations§
Source§impl Debug for ReplSession
impl Debug for ReplSession
Source§impl Default for ReplSession
impl Default for ReplSession
Source§fn default() -> ReplSession
fn default() -> ReplSession
Auto Trait Implementations§
impl Freeze for ReplSession
impl RefUnwindSafe for ReplSession
impl Send for ReplSession
impl Sync for ReplSession
impl Unpin for ReplSession
impl UnsafeUnpin for ReplSession
impl UnwindSafe for ReplSession
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.