Treating a Type as an Opaque Blob of Bytes (original) (raw)
The bindgen User Guide
Treating a Type as an Opaque Blob of Bytes
Sometimes a type definition is simply not translatable to Rust, for example it usesC++'s SFINAE for which Rust has no equivalent. In these cases, it is best to treat all occurrences of the type as an opaque blob of bytes with a size and alignment. bindgen
will attempt to detect such cases and do this automatically, but other times it needs some explicit help from you.
Library
Command Line
--opaque-type <type>
Annotation
/// <div rustbindgen opaque></div>
class Foo {
// ...
};