1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Package cadlib provides Rust bindings for the `SimScale` cadlib native library.
//!
//! This crate links against the **prebuilt** cadlib native library over the
//! stable C ABI (`libcadlib.so`). Install the native library first
//! (see <https://github.com/SimScaleGmbH/simscale-rust-cadlib#install>);
//! the crate's `build.rs` links it by name (`-lcadlib`).
//!
//! [`Cad::load`] takes the CAD data map entry of a workflow method's run request:
//! `Cad::load(&request.data_map.cad)?`.
//!
//! ```no_run
//! use cadlib::{Cad, VolumeParameters};
//!
//! # let cad_model = serde_json::json!({});
//! let cad = Cad::load(&cad_model)?;
//! let params = VolumeParameters { entity_ids: vec!["B1_TE5".to_string()] };
//! let result = cad.volume(Some(¶ms))?;
//! println!("{result:?}");
//! # Ok::<(), cadlib::CadLibError>(())
//! ```
//!
//! All query methods are **blocking**. From an async (e.g. tokio) context, run
//! them on the blocking pool so they don't stall the runtime:
//!
//! ```ignore
//! let result = tokio::task::spawn_blocking(move || cad.volume(Some(¶ms))).await??;
//! ```
pub use Cad;
pub use CadLibError;
pub use *;
pub use version;