pit

Bytes

Back to index

OpenPitBytesView

Non-owning byte slice view.

Lifetime contract:

typedef struct OpenPitBytesView {
    const uint8_t * ptr;
    size_t len;
} OpenPitBytesView;

OpenPitSharedBytes

Owning 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:

typedef struct OpenPitSharedBytes OpenPitSharedBytes;

openpit_destroy_shared_bytes

Releases a OpenPitSharedBytes handle.

Null input is a no-op.

void openpit_destroy_shared_bytes(
    OpenPitSharedBytes * handle
);

openpit_shared_bytes_view

Borrows 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
);