Skip to main content

generate_from_abi_with_source

Function generate_from_abi_with_source 

Source
pub fn generate_from_abi_with_source(
    abi_path: impl AsRef<Path>,
    source_path: impl AsRef<Path>,
    output_dir: impl AsRef<Path>,
) -> AptosResult<()>
Expand description

Generates Rust code from an ABI file with Move source for better names.

§Arguments

  • abi_path - Path to the ABI JSON file
  • source_path - Path to the Move source file
  • output_dir - Directory where generated code will be written

§Errors

Returns an error if:

  • The ABI file cannot be read
  • The ABI JSON cannot be parsed
  • The Move source file cannot be read
  • Code generation fails
  • The output directory cannot be created
  • The output file cannot be written