pub struct HarnessAdapter {
pub descriptor: WorkerDescriptor,
pub program: String,
pub build_args: ArgsBuilder,
pub parse: OutputParser,
pub line_mapper: LineMapper,
pub prompt_via_stdin: bool,
pub default_timeout: Duration,
}Expand description
A generic harness worker driven over the subprocess-json transport. Each
concrete CLI supplies its program name, argv builder, output parser, and an
optional line mapper for richer streaming.
Fields§
§descriptor: WorkerDescriptor§program: String§build_args: ArgsBuilder§parse: OutputParser§line_mapper: LineMapper§prompt_via_stdin: boolWhether the prompt is piped via stdin (vs. passed as an argument).
default_timeout: DurationTrait Implementations§
Source§impl Worker for HarnessAdapter
impl Worker for HarnessAdapter
Source§fn descriptor(&self) -> &WorkerDescriptor
fn descriptor(&self) -> &WorkerDescriptor
The worker’s self-description, used by the scheduler to resolve a node’s
capability
needs to a concrete worker.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecuteRequest,
events: EventSink,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<ExecuteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Do one unit of work. Returns the normalized result, or an error if the
worker could not be driven at all (distinct from a worker that ran and
reported
ExecStatus::Failed).Auto Trait Implementations§
impl Freeze for HarnessAdapter
impl RefUnwindSafe for HarnessAdapter
impl Send for HarnessAdapter
impl Sync for HarnessAdapter
impl Unpin for HarnessAdapter
impl UnsafeUnpin for HarnessAdapter
impl UnwindSafe for HarnessAdapter
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