Skip to main content

register_callback

Function register_callback 

Source
pub fn register_callback<F>(name: &str, f: F) -> Result<(), FfiError>
where F: Fn(FfiBuffer) -> FfiResult + Send + Sync + 'static,
Expand description

Register a named callback from Rust code.

The closure receives an FfiBuffer input and must return an FfiResult.

§Thread safety

This function acquires the global callback registry lock. Returns Err if the lock is poisoned.