Trait uniffi_bindgen::BindingGenerator
source · [−]pub trait BindingGenerator: Sized {
type Config: BindingGeneratorConfig;
fn write_bindings(
&self,
ci: ComponentInterface,
config: Self::Config,
out_dir: &Utf8Path
) -> Result<()>;
}
Expand description
A trait representing a UniFFI Binding Generator
External crates that implement binding generators, should implement this type
and call the generate_external_bindings
using a type that implements this trait.
Required Associated Types
Associated type representing a the bindings-specifig configuration parsed from the uniffi.toml
Required Methods
fn write_bindings(
&self,
ci: ComponentInterface,
config: Self::Config,
out_dir: &Utf8Path
) -> Result<()>
fn write_bindings(
&self,
ci: ComponentInterface,
config: Self::Config,
out_dir: &Utf8Path
) -> Result<()>
Writes the bindings to the output directory
Arguments
ci
: AComponentInterface
representing the interfaceconfig
: A instance of the BindingGeneratorConfig associated with this typeout_dir
: The path to where the binding generator should write the output bindings