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.
Auto Trait Implementations§
impl Freeze for BindingModule
impl RefUnwindSafe for BindingModule
impl !Send for BindingModule
impl !Sync for BindingModule
impl Unpin for BindingModule
impl UnwindSafe for BindingModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more