pub struct Opts {
pub format: bool,
pub split_interfaces: bool,
pub export_prefix: Option<String>,
pub internal_prefix: Option<String>,
pub ownership: Ownership,
pub api_style: APIStyle,
/* private fields */
}
Fields§
§format: bool
Call clang-format on the generated code
split_interfaces: bool
Place each interface in its own file, this enables sharing bindings across projects
export_prefix: Option<String>
Optionally prefix any export names with the specified value.
This is useful to avoid name conflicts when testing.
internal_prefix: Option<String>
Wrap all C++ classes inside a custom namespace.
This avoids identical names across components, useful for native
ownership: Ownership
Whether to generate owning or borrowing type definitions.
Valid values include:
-
owning
: Generated types will be composed entirely of owning fields, regardless of whether they are used as parameters to imports or not. -
borrowing
: Generated types used as parameters to imports will be “deeply borrowing”, i.e. contain references rather than owned values when applicable. -
borrowing-duplicate-if-necessary
: As above, but generating distinct types for borrowing and owning, if necessary.
api_style: APIStyle
Set API style to symmetric or asymmetric