pub struct ExecAdapter {
pub program: String,
pub args: Vec<String>,
pub timeout: Duration,
}Expand description
An external adapter binary speaking the newline-JSON protocol.
Fields§
§program: StringPath or name of the adapter executable.
args: Vec<String>Arguments passed through to the adapter.
timeout: DurationWall-clock budget for the whole run; exceeded adapters are killed.
Implementations§
Source§impl ExecAdapter
impl ExecAdapter
Sourcepub fn new(program: impl Into<String>) -> Self
pub fn new(program: impl Into<String>) -> Self
Create an adapter driver for program with the spec’s default
timeout (600 s).
Sourcepub fn collect(&self) -> Result<Vec<CheckResult>, HarnessError>
pub fn collect(&self) -> Result<Vec<CheckResult>, HarnessError>
Spawn the adapter, read NDJSON results, convert protocol lines into
check results (control failures normalize to ControlOk).
Enforces self.timeout: an adapter that outlives it is killed and
reported as HarnessError::Timeout rather than hanging the caller.
Auto Trait Implementations§
impl Freeze for ExecAdapter
impl RefUnwindSafe for ExecAdapter
impl Send for ExecAdapter
impl Sync for ExecAdapter
impl Unpin for ExecAdapter
impl UnsafeUnpin for ExecAdapter
impl UnwindSafe for ExecAdapter
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