pub struct Bindgen { /* private fields */ }Expand description
Implementations§
Source§impl Bindgen
impl Bindgen
Sourcepub fn input_default(&mut self) -> &mut Self
pub fn input_default(&mut self) -> &mut Self
Adds the default Windows metadata.
Sourcepub fn input_bytes(&mut self, input: &[u8]) -> &mut Self
pub fn input_bytes(&mut self, input: &[u8]) -> &mut Self
Adds a .winmd file from memory.
Sourcepub fn input_byte_sets<I, B>(&mut self, inputs: I) -> &mut Self
pub fn input_byte_sets<I, B>(&mut self, inputs: I) -> &mut Self
Adds .winmd files from memory.
Sourcepub fn filter(&mut self, filter: &str) -> &mut Self
pub fn filter(&mut self, filter: &str) -> &mut Self
Add a filter rule to include or exclude APIs.
Filter rules may be a function or type name, a namespace prefix, a fully-qualified name,
or a method-level entry of the form Namespace.Type::Method (with optional Property /
Event sugar). Prefix with ! to exclude rather than include. See the crate-level
docs for the full grammar.
Sourcepub fn filter_file(&mut self, input: impl AsRef<Path>) -> &mut Self
pub fn filter_file(&mut self, input: impl AsRef<Path>) -> &mut Self
Adds filter rules from a text file.
Sourcepub fn filter_files<I, S>(&mut self, inputs: I) -> &mut Self
pub fn filter_files<I, S>(&mut self, inputs: I) -> &mut Self
Adds filter rules from text files.
Sourcepub fn filters<I, S>(&mut self, filters: I) -> &mut Self
pub fn filters<I, S>(&mut self, filters: I) -> &mut Self
Add multiple filter rules to include or exclude APIs.
Filter rules may be a function or type name, a namespace prefix, a fully-qualified name,
or a method-level entry of the form Namespace.Type::Method (with optional Property /
Event sugar). Prefix with ! to exclude rather than include. See the crate-level
docs for the full grammar.
Sourcepub fn derives<I, S>(&mut self, derives: I) -> &mut Self
pub fn derives<I, S>(&mut self, derives: I) -> &mut Self
Add multiple extra traits for types to derive.
Sourcepub fn rustfmt(&mut self, rustfmt: &str) -> &mut Self
pub fn rustfmt(&mut self, rustfmt: &str) -> &mut Self
Override the default Rust formatter path.
Sourcepub fn package(&mut self) -> &mut Self
pub fn package(&mut self) -> &mut Self
Generate bindings as a package with one file per namespace.
Sourcepub fn package_feature_root(&mut self, namespace: &str) -> &mut Self
pub fn package_feature_root(&mut self, namespace: &str) -> &mut Self
Treats the given top-level package namespace as a feature-only root whose child namespaces depend directly on one another.
Sourcepub fn external_reference(
&mut self,
filter: &str,
rust_path_prefix: &str,
style: ReferenceStyle,
) -> &mut Self
pub fn external_reference( &mut self, filter: &str, rust_path_prefix: &str, style: ReferenceStyle, ) -> &mut Self
Routes metadata types matched by filter to an external Rust crate or module prefix.
The filter uses the same namespace and type syntax as Bindgen::filter. Routed types
remain available as dependencies of generated APIs, but are not generated in this output
package or represented by local Cargo feature gates. style controls whether the full
metadata namespace, its root-stripped form, or no namespace is appended to the Rust path.
builder.external_reference(
"Vendor.Types",
"vendor_bindings",
windows_bindgen::ReferenceStyle::Full,
);Sourcepub fn reference(
&mut self,
rust_path_prefix: &str,
style: ReferenceStyle,
filter: &str,
) -> &mut Self
pub fn reference( &mut self, rust_path_prefix: &str, style: ReferenceStyle, filter: &str, ) -> &mut Self
Maps referenced metadata to a Rust crate or module prefix.
Unlike Bindgen::external_reference, an explicitly selected local type takes
precedence over this reference. This matches the historical --reference behavior.
Sourcepub fn implement_all(&mut self) -> &mut Self
pub fn implement_all(&mut self) -> &mut Self
Includes implementation traits for every WinRT interface in scope.
Sourcepub fn implement(&mut self, name: &str) -> &mut Self
pub fn implement(&mut self, name: &str) -> &mut Self
Includes implementation traits for a WinRT interface or namespace prefix.
The name may be a fully-qualified type name (Namespace.Name) or a namespace prefix that
matches every type defined under it.
Sourcepub fn implements<I, S>(&mut self, names: I) -> &mut Self
pub fn implements<I, S>(&mut self, names: I) -> &mut Self
Includes implementation traits for multiple WinRT interfaces or namespace prefixes.
Sourcepub fn compose(&mut self, name: &str) -> &mut Self
pub fn compose(&mut self, name: &str) -> &mut Self
Selects a composable WinRT class as a minimal-mode composition target.
The class and its composable factory methods must also be selected by a filter.
Sourcepub fn composes<I, S>(&mut self, names: I) -> &mut Self
pub fn composes<I, S>(&mut self, names: I) -> &mut Self
Selects multiple composable WinRT classes as minimal-mode composition targets.
Sourcepub fn sys(&mut self) -> &mut Self
pub fn sys(&mut self) -> &mut Self
Generate raw or sys-style Rust bindings.
Mutually exclusive with Bindgen::minimal; panics if minimal was
already selected.
Sourcepub fn minimal(&mut self) -> &mut Self
pub fn minimal(&mut self) -> &mut Self
Generate minimal-mode Rust bindings.
Drops per-class wrapper methods, inherited interface forwarders, handle ergonomics, and free-function wrappers.
Mutually exclusive with --sys.
Sourcepub fn extern_fns(&mut self) -> &mut Self
pub fn extern_fns(&mut self) -> &mut Self
Generate extern declarations rather than link! macros for sys-style Rust bindings.
Only valid in combination with Bindgen::sys; panics otherwise.