3 stable releases

2.2.4 Oct 18, 2023
2.1.4 Oct 17, 2023
2.0.4 Oct 10, 2023

#867 in Science

Download history 208/week @ 2024-07-21 243/week @ 2024-07-28 216/week @ 2024-08-04 204/week @ 2024-08-11 240/week @ 2024-08-18 261/week @ 2024-08-25 246/week @ 2024-09-01 618/week @ 2024-09-08 277/week @ 2024-09-15 557/week @ 2024-09-22 380/week @ 2024-09-29 509/week @ 2024-10-06 421/week @ 2024-10-13 662/week @ 2024-10-20 522/week @ 2024-10-27 388/week @ 2024-11-03

1,997 downloads per month
Used in fmu-runner

MIT/Apache

55KB
1.5K SLoC

libfmi

Crates.io Documentation Crates.io

Generated Rust fmi-standard bindings.

This crate also includes a variadic logging handler as inspired by rust-fmi.

Example

use libfmi::Fmi2Dll;

let fmi = unsafe { Fmi2Dll::new("../tests/fmu/bouncing_ball/binaries/linux64/bouncing_ball.so") }?;
let version = unsafe { fmi.fmi2GetVersion() };

println!("FMI version: {:?}", unsafe {
    std::ffi::CStr::from_ptr(version)
});


lib.rs:

Generated Rust fmi-standard bindings.

This crate also includes a variadic logging handler as inspired by rust-fmi.

Example

use libfmi::Fmi2Dll;

let fmi = unsafe { Fmi2Dll::new("../tests/fmu/bouncing_ball/binaries/linux64/bouncing_ball.so") }?;
let version = unsafe { fmi.fmi2GetVersion() };

println!("FMI version: {:?}", unsafe {
    std::ffi::CStr::from_ptr(version)
});

Dependencies

~0.1–4.5MB