Struct opencv_binding_generator::Generator
source · 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: &str,
panic_on_error: bool,
entity_processor: impl FnOnce(Entity<'_>)
)
pub fn pre_process( &self, module: &str, 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: &str, visitor: impl GeneratorVisitor)
pub fn generate(&self, module: &str, visitor: impl GeneratorVisitor)
Runs the full binding generation process using the supplied visitor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl !Send for Generator
impl !Sync for Generator
impl Unpin 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