Function uniffi_bindgen::generate_external_bindings
source · [−]pub fn generate_external_bindings(
binding_generator: impl BindingGenerator,
udl_file: impl AsRef<Utf8Path>,
config_file_override: Option<impl AsRef<Utf8Path>>,
out_dir_override: Option<impl AsRef<Utf8Path>>
) -> 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:
- It parses the
udl
in aComponentInterface
- Parses the
uniffi.toml
and loads it into the type that implementsBindingGeneratorConfig
- Creates an instance of
BindingGenerator
, based on type argumentB
, and runBindingGenerator::write_bindings
on it
Arguments
binding_generator
: Type that implements BindingGeneratorudl_file
: The path to the UDL fileconfig_file_override
: The path to the configuration toml file, most likely calleduniffi.toml
. IfNone
, the function will try to guess based on the crate’s root.out_dir_override
: The path to write the bindings to. IfNone
, it will be the path to the parent directory of theudl_file