pub struct Generator { /* private fields */ }Expand description
Main workhorse for generating OpenCV bindings for a specific module
Full binding generation for a module is happening in the following major phases:
- Headers are parsed with
libclang - [crate::generator_env::GeneratorEnvPopulator] collects the data necessary in the binding generation (1st pass)
- Binding entities are extracted using the data from step 2 (2nd pass)
- Specific source files are generated by crate::writer::RustNativeBindingWriter (at the moment)
Implementations§
Source§impl Generator
impl Generator
pub fn new( opencv_include_dir: &Path, additional_include_dirs: &[&Path], src_cpp_dir: &Path, ) -> Self
pub fn is_clang_loaded(&self) -> bool
pub fn clang_version(&self) -> String
pub fn build_clang_command_line_args(&self) -> Vec<Cow<'static, str>>
Sourcepub fn pre_process(
&self,
module: SupportedModule,
panic_on_error: bool,
entity_processor: impl FnOnce(Entity<'_>),
)
pub fn pre_process( &self, module: SupportedModule, panic_on_error: bool, entity_processor: impl FnOnce(Entity<'_>), )
Runs the clang header parsing, check for the compilation errors and hands off to entity_processor
Sourcepub fn generate(
&self,
module: SupportedModule,
panic_on_error: bool,
visitor: impl for<'tu> GeneratorVisitor<'tu>,
)
pub fn generate( &self, module: SupportedModule, panic_on_error: bool, visitor: impl for<'tu> GeneratorVisitor<'tu>, )
Runs the full binding generation process using the supplied visitor