COOLPROP

Static COOLPROP 

Source
pub static COOLPROP: LazyLock<Mutex<CoolProp>>
Expand description

Global instance of the CoolProp dynamic library.

Provides thread-safe access to a single CoolProp instance across the entire application. The library is loaded lazily on first access using LazyLock.

Access to the library is protected by a Mutex, ensuring thread safety. To use the library, acquire the lock:

use coolprop_sys::COOLPROP;

let coolprop = COOLPROP.lock().unwrap();
// Use CoolProp methods here

§Panics

Panics on initialization if the CoolProp dynamic library cannot be loaded (e.g., if the library file is missing or corrupted).

§Safety

Internally uses unsafe to load the dynamic library via FFI. Safety is ensured because:

  • The library is loaded from the verified COOLPROP_PATH
  • Loading occurs once during initialization
  • All subsequent accesses work with the already loaded library

§See Also