pub struct Opts {
pub format: bool,
pub split_interfaces: bool,
pub export_prefix: Option<String>,
pub internal_prefix: Option<String>,
pub api_style: APIStyle,
pub ownership: Ownership,
/* 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
api_style: APIStyle
Set API style to symmetric or asymmetric
ownership: Ownership
Whether to generate owning or borrowing type definitions for record
arguments to imported functions.
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. -
coarse-borrowing
: Generated types used as parameters to imports will be “deeply borrowing”, i.e. contain references rather than owned values, so long as they don’t contain resources, in which case they will be owning. -
`fine-borrowing“: Generated types used as parameters to imports will be “deeply borrowing”, i.e. contain references rather than owned values for all fields that are not resources, which will be owning.