Skip to main content

asset_importer_sys/
lib.rs

1//! Low-level FFI bindings for the Assimp 3D asset import library
2//!
3//! This crate provides raw, unsafe bindings to the Assimp C API.
4//! For safe, idiomatic Rust bindings, use the `asset-importer` crate instead.
5
6#![allow(non_upper_case_globals)]
7#![allow(non_camel_case_types)]
8#![allow(non_snake_case)]
9#![allow(dead_code)]
10#![allow(clippy::all)]
11#![allow(unpredictable_function_pointer_comparisons)]
12
13#[cfg(any(
14    all(feature = "system", feature = "prebuilt"),
15    all(feature = "system", feature = "build-assimp"),
16    all(feature = "prebuilt", feature = "build-assimp"),
17))]
18compile_error!(
19    "Build mode features are mutually exclusive. Use at most one of: `system`, `prebuilt`, `build-assimp`.\n\
20     Hint: use `system` to link against a system-installed Assimp, `prebuilt` to download prebuilt binaries, or `build-assimp` to build from source."
21);
22
23#[cfg(all(feature = "system", not(feature = "generate-bindings")))]
24compile_error!(
25    "feature `system` requires `generate-bindings` so Rust bindings match the system Assimp headers.\n\
26     Hint: enable `asset-importer-sys/generate-bindings` (or use `build-assimp` / `prebuilt`)."
27);
28
29// Include the generated bindings
30include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
31
32// Re-export commonly used types for convenience
33pub use aiImporterDesc as ImporterDesc;
34pub use aiScene as Scene;
35
36// Import/Export function aliases for clarity
37pub use aiImportFile as import_file;
38pub use aiReleaseImport as release_import;
39
40/// Version information for this crate
41pub const CRATE_VERSION: &str = env!("CARGO_PKG_VERSION");
42
43// Include tests
44mod test;
45
46// Include type extensions (optional convenience implementations)
47#[cfg(feature = "type-extensions")]
48pub mod types;