Function generate_wrapper_crate

Source
pub fn generate_wrapper_crate(
    wit: &Utf8Path,
    js: &Utf8Path,
    output: &Utf8Path,
    world: Option<&str>,
) -> Result<()>
Expand description

Generates a Rust wrapper crate for a combination of a WIT package and a JavaScript module.

The wit parameter should point to a WIT root (holding the WIT package of the component, with optionally a deps subdirectory with an arbitrary number of dependencies).

The js parameter must point to a single JavaScript module that implements the WIT package.

The output parameter is the root directory where the generated Rust crate’s source code and Cargo manifest is placed.

If world is None, the default world is selected and used, otherwise the specified one.