epanet-sys 2.3.0

Raw FFI bindings to the EPANET 2.3 water distribution network simulator
Documentation
  • Coverage
  • 99.29%
    420 out of 423 items documented1 out of 2 items with examples
  • Size
  • Source code size: 2.11 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.79 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 30s Average build duration of successful builds.
  • all releases: 30s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cameron-devine/epanet-sys
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cameron-devine

epanet-sys

Raw FFI bindings to the EPANET 2.3 C library for water distribution network modeling and simulation.

The EPANET source is included as a git submodule and compiled via CMake at build time. Rust bindings are generated by bindgen.

If you want a safe, idiomatic Rust API, use the rusty-epanet crate instead.

Prerequisites

  • CMake and a C compiler (MSVC on Windows, GCC/Clang on Linux/macOS)
  • libclang (for bindgen)

Usage

[dependencies]
epanet-sys = "2.3"

All EPANET C API functions are available as unsafe extern functions:

use epanet_sys::*;

unsafe {
    let mut ph: EN_Project = std::ptr::null_mut();
    EN_createproject(&mut ph);
    // ...
    EN_deleteproject(ph);
}

Linking

By default the EPANET C library is statically linked into your binary.

To use dynamic linking instead:

[dependencies]
epanet-sys = { version = "2.3", default-features = false, features = ["dynamic-link"] }

Versioning

The crate version tracks the EPANET C library version (2.3.x).

License

MIT