Function chemfiles::set_warning_callback [] [src]

pub fn set_warning_callback<F>(callback: F) -> Result<()> where
    F: Fn(&str) + 'static, 

Use callback for every chemfiles warning. The callback will be passed the warning message.

Caveats

This function will box and forget the callback, effectivelly leaking it. Calling this function multiple time will leak all callbacks.

This function hold a Mutex under the hood, and will block when called from multiple threads. You should really call this function once, at the beggining of your application.