Handles have been introduced as a way to avoid passing pointers directly, specifically for languages which don't support pointers nicely. The FFI currently has a mix of functions which require a pointer or handles.
Unfortunately, a number of FFI functions still require a pointer, and do not have a handle equivalent. As one example of the discrepancy:
pactffi_with_specification takes a Pact handle and updates the specification; but,
pactffi_pact_spec_version takes a Pact pointer and return the specification.
There's unfortunately no way at present to obtain the pointer of the Pact behind a specific Pact handle.
Currently, both the Pact handle and Pact pointer own their content. We can add a function to return a Pact pointer from a Pact handle, but it will be clone of the contents.
Handles have been introduced as a way to avoid passing pointers directly, specifically for languages which don't support pointers nicely. The FFI currently has a mix of functions which require a pointer or handles.
Unfortunately, a number of FFI functions still require a pointer, and do not have a handle equivalent. As one example of the discrepancy:
pactffi_with_specification
takes a Pact handle and updates the specification; but,pactffi_pact_spec_version
takes a Pact pointer and return the specification.There's unfortunately no way at present to obtain the pointer of the Pact behind a specific Pact handle.