pub fn cargo() -> Result<Command>Expand description
Constructs a new Command for launching cargo targeting
hyperlight guest code.
The value of the CARGO environment variable is used if it is set; otherwise, the
default cargo from the system PATH is used.
If RUSTUP_TOOLCHAIN is set in the environment, it is also propagated to the
child process to ensure correct functioning of the rustup wrappers.
The default configuration is:
- No arguments to the program
- Inherits the current process’s environment
- Inherits the current process’s working directory
§Errors
This function will return an error if:
- If the
CARGOenvironment variable is set but it specifies an invalid path - If the
CARGOenvironment variable is not set and thecargoprogram cannot be found in the system PATH
§Examples
Basic usage:
use cargo_hyperlight::cargo;
let command = cargo().unwrap();