pub struct ProcessDriver { /* private fields */ }Expand description
One instantiated process driver. The runtime keeps one for a whole run, so the driver may
carry what launch was given into parse.
Implementations§
Source§impl ProcessDriver
impl ProcessDriver
Sourcepub async fn instantiate(
engine: &Engine,
component: &Component,
name: &str,
version: &str,
) -> Result<Self, RuntimeError>
pub async fn instantiate( engine: &Engine, component: &Component, name: &str, version: &str, ) -> Result<Self, RuntimeError>
Instantiates component with no grants: a WASI context with no environment, arguments,
preopened directories, inherited stdio or network, and no Murmur host import.
Each call into the driver is bounded by the hook call limits
(ExecutionLimits::for_hook_calls with no declared deadline), so engine must have an
epoch ticker running. name and version identify the driver in errors. Any failure,
including an import the empty context does not provide, is
RuntimeError::ProcessDriverLoad carrying wasmtime’s message.
Sourcepub async fn describe(&mut self) -> Result<Description, RuntimeError>
pub async fn describe(&mut self) -> Result<Description, RuntimeError>
Calls the driver’s describe.
A trap, an exceeded deadline, or a required-env entry that is not a usable variable
name (empty, or containing = or NUL) is RuntimeError::ProcessDriverLoad.
Sourcepub async fn launch(
&mut self,
request: LaunchRequest,
) -> Result<Result<LaunchPlan, String>, RuntimeError>
pub async fn launch( &mut self, request: LaunchRequest, ) -> Result<Result<LaunchPlan, String>, RuntimeError>
Asks the driver to plan one harness run. The inner Err is the driver’s own refusal,
reported to the operator verbatim; the outer one is a trap or an exceeded deadline.
Sourcepub async fn parse(
&mut self,
lines: Vec<String>,
) -> Result<Vec<Event>, RuntimeError>
pub async fn parse( &mut self, lines: Vec<String>, ) -> Result<Vec<Event>, RuntimeError>
Reads one batch of complete stdout lines into events. The same instance serves a whole
run, so the driver may answer from what launch was given.
Sourcepub async fn classify_exit(
&mut self,
exit: ExitStatus,
) -> Result<Event, RuntimeError>
pub async fn classify_exit( &mut self, exit: ExitStatus, ) -> Result<Event, RuntimeError>
Asks the driver what a run whose output ended without a terminal event amounts to.
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessDriver
impl !Sync for ProcessDriver
impl !UnwindSafe for ProcessDriver
impl Freeze for ProcessDriver
impl Send for ProcessDriver
impl Unpin for ProcessDriver
impl UnsafeUnpin for ProcessDriver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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