Skip to main content

Driving

Trait Driving 

Source
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 shellsexactly what environment(&Layout) returned
where the session is laida directory of the run’s own (run), or the caller’s (run_at)
what ends ita pidfd on the subject, watched and never signalled; then the group is killed
what comes backRun, and Run::wholeWhole

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§

Source

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,

A workspace of the run’s own, gone when the run ends.

Source

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,

The caller’s directory instead — it exists, and is the caller’s to have made — left behind: a reading taken later may follow source paths into it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§