Struct rusty_bind_parser::binding_module::BindingModule
source · pub struct BindingModule { /* private fields */ }
Expand description
The structure consist of:
- extern blocks translator module, i.e.
extern "Rust"
andextern "Traits"
, - generated extern functions that wrap the actual user’s methods.
Implementations§
source§impl BindingModule
impl BindingModule
sourcepub fn translate_module(module: ItemMod, context: &BuildContext) -> Result<Self>
pub fn translate_module(module: ItemMod, context: &BuildContext) -> Result<Self>
The method translates Rust module containing extern "Rust"
and generates all
needed wrappers.
sourcepub fn generate_binding_files(&self) -> GeneratedFilesContent
pub fn generate_binding_files(&self) -> GeneratedFilesContent
Method generates C++, Swift and SWIG glue code. The latter is needed to generate glue code for other target languages like Java, C#, Python etc.
sourcepub fn get_tokens(&self) -> TokenStream
pub fn get_tokens(&self) -> TokenStream
Returns the whole generated code in the form of a token stream. It wraps the derived module into another one in order to avoid custom types and wrappers types names collision.