run

Function run 

Source
pub fn run(
    file_name: &str,
    function: &str,
    args: &[Arg],
) -> Result<Vec<Felt252>, SierraRunnerError>
Expand description

Runs the specified function with the provided arguments.

§Arguments

  • file_name - A string slice that holds the file name.
  • function - A string slice that holds the function to run.
  • args - A slice of Arg that holds the arguments to the function.

§Returns

  • Result<Vec<Felt252>> - A Result containing a vector of Felt252 if the function runs successfully, or an error if it fails.

§Errors

This function will return an error if:

  • The file specified by file_name cannot be found or read.
  • The function specified by function cannot be found in the file.
  • The arguments provided in args are not valid for the function.
  • The function execution fails for any reason.