lib.rs

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2022 Jun 16 6:2
Editor
Edited
Edited
2024 May 19 16:1
Refs
Refs
mod crate 선언
 
 

build.rs
binding in lib.rs

  • lib.rs file can include the generated bindings and allows the Rust code to interact with the C functions.
  • The #![allow(...)] attributes are used to suppress warnings about naming conventions.
  • include!(concat!(env!("OUT_DIR"), "/bindings.rs"));: This line includes the generated bindings file, which is created by bindgen during the build process.

Source code usage

  • The extern "C" block declares the image_classifier function from the Darknet library, making it available for use in Rust.
  • This function can be called from the Rust code as if it were a normal Rust function.
 
 
 
 

Recommendations