Function conch_runtime::spawn::spawn_with_local_redirections[][src]

pub fn spawn_with_local_redirections<I, S, E: ?Sized>(
    redirects: I,
    cmd: S
) -> LocalRedirections<I::IntoIter, S, E, RedirectRestorer<E>> where
    I: IntoIterator,
    I::Item: RedirectEval<E>,
    S: Spawn<E>,
    E: FileDescEnvironment,
    E::FileHandle: Clone

Creates a future which will evaluate a number of local redirects before spawning the inner command.

The local redirects will be evaluated and applied to the environment one by one, after which the inner command will be spawned and polled.

Upon resolution of the inner future (successful or with an error), or if this future is cancelled, the local redirects will be removed and restored with their previous file descriptors.

Note: any other file descriptor changes that may be applied to the environment externally will NOT be captured or restored here.