pub struct GraphRunner { /* private fields */ }Expand description
Runs a graph spec in a Python subprocess rooted at the project.
Implementations§
Source§impl GraphRunner
impl GraphRunner
Sourcepub fn new(project_dir: impl Into<PathBuf>) -> Self
pub fn new(project_dir: impl Into<PathBuf>) -> Self
A runner for project_dir, using $SOMA_PYTHON when set.
The interpreter matters: it must be one that can import soma and
import the project’s own modules. Defaulting to python3 is right
far more often than guessing, and when it is wrong the error says
which interpreter could not find soma.
Sourcepub fn run(&self, spec: &Value) -> Result<Value, String>
pub fn run(&self, spec: &Value) -> Result<Value, String>
Run spec, returning the driver’s JSON payload.
Err is for the subprocess itself going wrong — no interpreter, a
crash, no answer written. A graph that failed to build or to run
comes back as Ok with "ok": false, because that is a result the
model can act on rather than an infrastructure problem.
Auto Trait Implementations§
impl Freeze for GraphRunner
impl RefUnwindSafe for GraphRunner
impl Send for GraphRunner
impl Sync for GraphRunner
impl Unpin for GraphRunner
impl UnsafeUnpin for GraphRunner
impl UnwindSafe for GraphRunner
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