pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
Sourcepub fn new(executor: Box<dyn Executor>, store: Box<dyn Store>) -> Session
pub fn new(executor: Box<dyn Executor>, store: Box<dyn Store>) -> Session
Build a session over an executor and a store, restoring any persisted macro history from the store.
Sourcepub fn seed_defs(&mut self, text: &str) -> Result<()>
pub fn seed_defs(&mut self, text: &str) -> Result<()>
Seed the macro table from a --defs file (validated first).
Sourcepub fn add_def(&mut self, line: &str) -> Result<()>
pub fn add_def(&mut self, line: &str) -> Result<()>
Add a def/macro line to the table (validated first). Unlike
a query line, a definition is not run.
Sourcepub fn eval(&self, line: &str) -> Result<Vec<Cell>>
pub fn eval(&self, line: &str) -> Result<Vec<Cell>>
Evaluate a line against the standing arbor (&N). Pure —
history is not touched (a failed line commits nothing).
Sourcepub fn eval_fresh(&self, line: &str) -> Result<Vec<Cell>>
pub fn eval_fresh(&self, line: &str) -> Result<Vec<Cell>>
Evaluate a line against a freshly re-materialized source — the
&N! live reading, which sees current data.
Sourcepub fn commit(&mut self, line: &str, snapshot: Vec<Cell>) -> bool
pub fn commit(&mut self, line: &str, snapshot: Vec<Cell>) -> bool
Register an accepted line as &N and capture its output as the
frozen footprint for &N#. Returns whether the line’s shape
could be a macro body (so &N will resolve); either way the
line number advances so labels track what the user saw.
Sourcepub fn frozen(&self, n: usize) -> Option<&Vec<Cell>>
pub fn frozen(&self, n: usize) -> Option<&Vec<Cell>>
The frozen output of line n, if captured — what a &N#
recall replays.
Sourcepub fn record_frozen(&mut self, snapshot: Vec<Cell>)
pub fn record_frozen(&mut self, snapshot: Vec<Cell>)
Record a frozen-recall line: it takes the next number and keeps its own snapshot, but is not itself a referenceable macro body.