[][src]Function shellfn_core::execute_void_result

pub fn execute_void_result<TArg, TEnvKey, TEnvVal, TError>(
    cmd: impl AsRef<OsStr>,
    args: impl IntoIterator<Item = TArg>,
    envs: impl IntoIterator<Item = (TEnvKey, TEnvVal)>
) -> Result<(), TError> where
    TArg: AsRef<OsStr>,
    TEnvKey: AsRef<OsStr>,
    TEnvVal: AsRef<OsStr>,
    TError: From<Error<NeverError>>, 

Executes command with args and environment variables, ignores output

  • On invalid command: return error
  • On error exit code: return error
  • On parsing failure: N/A
  • Possible errors: ProcessNotSpawned, WaitFailed, ProcessFailed (stdout and stderr always empty)

Designed for

use shellfn::shell;

#[shell]
fn command() -> Result<(), Box<Error>> {
    sleep 5
}

command()