OpenPitBytesViewNon-owning byte slice view.
Lifetime contract:
ptr points to len readable bytes;ptr;typedef struct OpenPitBytesView {
const uint8_t * ptr;
size_t len;
} OpenPitBytesView;
OpenPitSharedBytesOwning shared-bytes handle.
Use this type when an FFI function needs to hand a binary payload to the caller whose lifetime must extend beyond the single FFI call.
Ownership contract:
*mut OpenPitSharedBytes returned through FFI is owned by
the caller;openpit_destroy_shared_bytes when no
longer needed; failing to do so leaks the underlying allocation.typedef struct OpenPitSharedBytes OpenPitSharedBytes;
openpit_destroy_shared_bytesReleases a OpenPitSharedBytes handle.
Null input is a no-op.
void openpit_destroy_shared_bytes(
OpenPitSharedBytes * handle
);
openpit_shared_bytes_viewBorrows a read-only view of the bytes stored in the handle.
Returns an unset view (ptr == null, len == 0) when handle is null.
OpenPitBytesView openpit_shared_bytes_view(
const OpenPitSharedBytes * handle
);