Skip to main content

Executor

Trait Executor 

Source
pub trait Executor {
    // Required method
    fn run(&self, query: &str) -> Result<Vec<Cell>>;

    // Provided methods
    fn run_fresh(&self, query: &str) -> Result<Vec<Cell>> { ... }
    fn export(&self, _query: &str, _kind: &str) -> Result<String> { ... }
    fn complete(&self, text: &str, cursor: usize) -> Vec<Candidate> { ... }
}
Expand description

The materialization + query substrate. Implementations run a query against a standing arbor and return rendered Cells.

query is the whole text to run — the session prepends its macro table (def &N: …;) so history resolves inline, which also lets it cross a process boundary (the daemon) as plain text.

Required Methods§

Source

fn run(&self, query: &str) -> Result<Vec<Cell>>

Provided Methods§

Source

fn run_fresh(&self, query: &str) -> Result<Vec<Cell>>

Run against a freshly re-materialized source — the &N! live reading. The default re-runs against the standing arbor (an immutable source never drifts); executors that can re-open the source override it so a live reading sees current data, diverging from the frozen &N#.

Source

fn export(&self, _query: &str, _kind: &str) -> Result<String>

Run a query and render its results as exportable markup (md, html, txt) — structural through the text-level vocabulary for node results, projection lines otherwise. Unsupported by default.

Source

fn complete(&self, text: &str, cursor: usize) -> Vec<Candidate>

Tab-completion candidates at a byte cursor. The default answers the syntax tier (the stdlib registry needs no adapter), so even a daemon-backed session completes function names; executors with a live arbor override this with the data tier — real children, real annotations.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§