pub struct Generator { /* private fields */ }Expand description
Generator is a main point of rust_swig.
It expands rust macroses and generates not rust code.
It designed to use inside build.rs.
Implementations§
Source§impl Generator
impl Generator
pub fn new(config: LanguageConfig) -> Generator
Sourcepub fn with_pointer_target_width(self, pointer_target_width: usize) -> Self
pub fn with_pointer_target_width(self, pointer_target_width: usize) -> Self
By default we get pointer_target_width via cargo (more exactly CARGO_CFG_TARGET_POINTER_WIDTH), but you can change default value via this method
Sourcepub fn rustfmt_bindings(self, doit: bool) -> Self
pub fn rustfmt_bindings(self, doit: bool) -> Self
Set whether rustfmt should format the generated bindings.
Sourcepub fn remove_not_generated_files_from_output_directory(
self,
doit: bool,
) -> Self
pub fn remove_not_generated_files_from_output_directory( self, doit: bool, ) -> Self
If true removes not generated by rust_swig files from output directory, suitable for removing obsolete files. Warning! May remove your files if turn on, so by default false
Sourcepub fn merge_type_map(self, id_of_code: &str, code: &str) -> Generator
pub fn merge_type_map(self, id_of_code: &str, code: &str) -> Generator
Add new foreign langauge type <-> Rust mapping
Auto Trait Implementations§
impl Freeze for Generator
impl !RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin for Generator
impl UnsafeUnpin for Generator
impl !UnwindSafe for Generator
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