Visibility and pub
Structs and enums
By default, ALL structs and enums in #[diplomat::bridge] have bindings generated. If you wish to hide non-pub bindings, you must add the #[diplomat::skip_private_items] attribute to your module:
#[diplomat::bridge]
#[diplomat::skip_private_items]
mod ffi {
/// Will be hidden on bindings generation.
struct Hidden;
/// Bindings will generate for this struct.
pub struct Visible;
}
Methods
Any function that does not have pub is not generated by default.