pub fn generate_external_bindings<T: BindingGenerator>(
    binding_generator: &T,
    udl_file: impl AsRef<Utf8Path>,
    config_file_override: Option<impl AsRef<Utf8Path>>,
    out_dir_override: Option<impl AsRef<Utf8Path>>,
    library_file: Option<impl AsRef<Utf8Path>>,
    crate_name: Option<&str>,
    try_format_code: bool
) -> Result<()>
Expand description

Generate bindings for an external binding generator Ideally, this should replace the generate_bindings function below

Implements an entry point for external binding generators. The function does the following:


  • binding_generator: Type that implements BindingGenerator
  • udl_file: The path to the UDL file
  • config_file_override: The path to the configuration toml file, most likely called uniffi.toml. If None, the function will try to guess based on the crate’s root.
  • out_dir_override: The path to write the bindings to. If None, it will be the path to the parent directory of the udl_file
  • library_file: The path to a dynamic library to attempt to extract the definitions from and extend the component interface with. No extensions to component interface occur if it’s None
  • crate_name: Override the default crate name that is guessed from UDL file path.