alef 0.115.6

Opinionated polyglot binding generator for Rust libraries
Documentation
let client = unsafe { &*client };
{% for conversion in conversions %}
    {{ conversion }}
{% endfor %}
    // 16 MiB: tokio's ~2 MB default worker stack can overflow on a deep
    // extraction future (a nested archive member, a multi-stage OCR pipeline), and a
    // stack overflow aborts the process with SIGBUS instead of raising a catchable panic.
    const ASYNC_METHOD_RUNTIME_STACK_SIZE_BYTES: usize = 16 * 1024 * 1024;
    let rt = match tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .thread_stack_size(ASYNC_METHOD_RUNTIME_STACK_SIZE_BYTES)
        .build()
    {
        Ok(rt) => rt,
        Err(e) => {
            update_last_error(e);
            return std::ptr::null_mut();
        }
    };
    match rt.block_on(async { {{ core_call }}.await }) {
        Ok(result) => {
            let json = serde_json::to_string(&result).unwrap_or_default();
            std::ffi::CString::new(json).unwrap_or_default().into_raw()
        }
        Err(e) => {
            update_last_error(e);
            std::ptr::null_mut()
        }
    }