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 set_executor(&mut self, executor: Box<dyn Executor>)
pub fn set_executor(&mut self, executor: Box<dyn Executor>)
Swap the executor under a running session — an in-session
remount (:mount). History and the macro table stay: &N
re-runs against the new source set.
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).
Stored stripped of # comment lines: the table is prepended
to query text, and the query lexer has no comment syntax.
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 export(&self, line: &str, kind: &str) -> Result<String>
pub fn export(&self, line: &str, kind: &str) -> Result<String>
Run a line and render its results as exportable markup
(md, html, txt) — the panel’s rendered-export path.
History refs resolve inline, exactly as in eval;
an empty line exports the whole document.
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.
Sourcepub fn complete(&self, text: &str, cursor: usize) -> Vec<Candidate>
pub fn complete(&self, text: &str, cursor: usize) -> Vec<Candidate>
The &N a fresh line will claim.
Tab-completion candidates for a line being edited.
Session-aware by construction: the executor answers with
its live arbor when it has one, the syntax tier otherwise.
pub fn line_no(&self) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl !UnwindSafe for Session
impl Freeze for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more