pub trait Driving: Rig {
// Provided methods
async fn run<A, E>(
&self,
argv: &[A],
environment: E,
) -> Result<Run<Kept<Self>>, Failure>
where A: AsRef<OsStr>,
E: FnOnce(&Layout) -> Result<Vec<(OsString, OsString)>, Failure>,
Self: Sized { ... }
async fn run_at<A, E>(
&self,
at: &Path,
argv: &[A],
environment: E,
) -> Result<Run<Kept<Self>>, Failure>
where A: AsRef<OsStr>,
E: FnOnce(&Layout) -> Result<Vec<(OsString, OsString)>, Failure>,
Self: Sized { ... }
}Expand description
A rig whose run Rust orchestrates. The impl block is empty: the whole contract is the two provided entries.
The command line is run as it is given and carries its own program, so a
caller wanting a launcher puts one there: env TARGET=staging -- bash x.bash is the whole story. environment is handed the settled Layout
and its return is the subject’s whole environment delta — the core
adds nothing. Fallible, because provisioning writes a file:
Layout::bash_env with a stated Provision is the
usual pair.
| what reaches the shells | exactly what environment(&Layout) returned |
| where the session is laid | a directory of the run’s own (run), or the caller’s (run_at) |
| what ends it | a pidfd on the subject, watched and never signalled; then the group is killed |
| what comes back | Run, and Run::whole → Whole |
The future is not Send: it runs on a LocalSet of its own, and is awaited
from a current-thread runtime or block_on.
Provided Methods§
Sourceasync fn run<A, E>(
&self,
argv: &[A],
environment: E,
) -> Result<Run<Kept<Self>>, Failure>
async fn run<A, E>( &self, argv: &[A], environment: E, ) -> Result<Run<Kept<Self>>, Failure>
A workspace of the run’s own, gone when the run ends.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".