ABI layout
Use this page when you call the C ABI directly or write an FFI binding. Each section gives the layout of one record that your code exchanges with the library.
- Sizes, alignments, and offsets are in bytes.
- A versioned record starts with its
sizeandversionheader. - Follow the ownership and initialization rules of each operation together with these layouts.
stardust_bytes
- Size: 16 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
data | const uint8_t * | 0 | 8 |
length | int64_t | 8 | 8 |
stardust_node_view
- Size: 56 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
kind | uint32_t | 0 | 4 |
boolean | uint32_t | 4 | 4 |
parent | uint32_t | 8 | 4 |
position | uint32_t | 12 | 4 |
first_child | uint32_t | 16 | 4 |
next_sibling | uint32_t | 20 | 4 |
key | stardust_bytes | 24 | 16 |
text | stardust_bytes | 40 | 16 |
stardust_node_input
- Size: 64 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size | Meaning |
|---|---|---|---|---|
parent | uint32_t | 0 | 4 | — |
kind | uint32_t | 4 | 4 | — |
boolean | uint32_t | 8 | 4 | — |
number | uint32_t | 12 | 4 | Selects integer or real for a Number node. Zero selects Integer. |
key | stardust_bytes | 16 | 16 | — |
text | stardust_bytes | 32 | 16 | — |
integer | int64_t | 48 | 8 | Contains the value when number is STARDUST_NUMBER_INTEGER. Otherwise, set integer to zero. |
real | double | 56 | 8 | Contains the finite value when number is STARDUST_NUMBER_FLOAT. Otherwise, set real to zero. |
stardust_diagnostic_view
- Size: 88 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
code | stardust_bytes | 0 | 16 |
message | stardust_bytes | 16 | 16 |
path | stardust_bytes | 32 | 16 |
field | stardust_bytes | 48 | 16 |
entity | int64_t | 64 | 8 |
offset | int64_t | 72 | 8 |
present | uint32_t | 80 | 4 |
reserved | uint32_t | 84 | 4 |
stardust_cost
- Size: 24 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
cpu_ticks | int64_t | 0 | 8 |
wall_ticks | int64_t | 8 | 8 |
arena_bytes | int64_t | 16 | 8 |
stardust_expr_build_explain
- Size: 88 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
prepare_expression | stardust_cost | 0 | 24 |
compile | stardust_cost | 24 | 24 |
total | stardust_cost | 48 | 24 |
arena_capacity | int64_t | 72 | 8 |
stages_completed | uint32_t | 80 | 4 |
cache_hit | uint32_t | 84 | 4 |
stardust_expr_eval_explain
- Size: 120 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
prepare_variables | stardust_cost | 0 | 24 |
evaluate | stardust_cost | 24 | 24 |
adopt_document | stardust_cost | 48 | 24 |
total | stardust_cost | 72 | 24 |
arena_capacity | int64_t | 96 | 8 |
document_bytes | int64_t | 104 | 8 |
stages_completed | uint32_t | 112 | 4 |
reserved | uint32_t | 116 | 4 |
stardust_license_view
- Size: 128 bytes
- Alignment: 8 bytes
- Versioned header: yes
| Field | C type | Offset | Size |
|---|---|---|---|
size | uint32_t | 0 | 4 |
version | uint32_t | 4 | 4 |
active | uint32_t | 8 | 4 |
failure | uint32_t | 12 | 4 |
support_end_ticks | int64_t | 16 | 8 |
expires_ticks | int64_t | 24 | 8 |
build_ticks | int64_t | 32 | 8 |
refused_support_end_ticks | int64_t | 40 | 8 |
subject | stardust_bytes | 48 | 16 |
license_id | stardust_bytes | 64 | 16 |
name | stardust_bytes | 80 | 16 |
license | stardust_bytes | 96 | 16 |
tier | stardust_bytes | 112 | 16 |
stardust_db_options
- Size: 64 bytes
- Alignment: 8 bytes
- Versioned header: yes
| Field | C type | Offset | Size |
|---|---|---|---|
size | uint32_t | 0 | 4 |
version | uint32_t | 4 | 4 |
create | uint32_t | 8 | 4 |
clear | uint32_t | 12 | 4 |
pin_memory | uint32_t | 16 | 4 |
page_size | uint32_t | 20 | 4 |
lock_timeout_ticks | int64_t | 24 | 8 |
initial_map_bytes | int64_t | 32 | 8 |
commit_batch_ticks | int64_t | 40 | 8 |
plugins | const stardust_document * | 48 | 8 |
memory_budget_bytes | int64_t | 56 | 8 |
stardust_db_query_options
- Size: 32 bytes
- Alignment: 8 bytes
- Versioned header: yes
| Field | C type | Offset | Size |
|---|---|---|---|
size | uint32_t | 0 | 4 |
version | uint32_t | 4 | 4 |
page_size | uint32_t | 8 | 4 |
reserved | uint32_t | 12 | 4 |
max_cost_ticks | int64_t | 16 | 8 |
as_of | int64_t | 24 | 8 |
stardust_db_write_options
- Size: 24 bytes
- Alignment: 8 bytes
- Versioned header: yes
| Field | C type | Offset | Size |
|---|---|---|---|
size | uint32_t | 0 | 4 |
version | uint32_t | 4 | 4 |
max_cost_ticks | int64_t | 8 | 8 |
as_of | int64_t | 16 | 8 |
stardust_db_query_explain
- Size: 224 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
load_definition | stardust_cost | 0 | 24 |
parameters | stardust_cost | 24 | 24 |
run | stardust_cost | 48 | 24 |
total | stardust_cost | 72 | 24 |
arena_capacity | int64_t | 96 | 8 |
work_ticks | int64_t | 104 | 8 |
rows | int64_t | 112 | 8 |
compile_ticks | int64_t | 120 | 8 |
plan_ticks | int64_t | 128 | 8 |
execute_ticks | int64_t | 136 | 8 |
group_ticks | int64_t | 144 | 8 |
order_ticks | int64_t | 152 | 8 |
memory_bytes | int64_t | 160 | 8 |
memory_refusals | int64_t | 168 | 8 |
budget_bytes | int64_t | 176 | 8 |
budget_used_bytes | int64_t | 184 | 8 |
budget_peak_bytes | int64_t | 192 | 8 |
budget_refusals | int64_t | 200 | 8 |
retry_ticks | int64_t | 208 | 8 |
stages_completed | uint32_t | 216 | 4 |
retries | uint32_t | 220 | 4 |
stardust_db_mutation_explain
- Size: 112 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
load_definition | stardust_cost | 0 | 24 |
parameters | stardust_cost | 24 | 24 |
run | stardust_cost | 48 | 24 |
total | stardust_cost | 72 | 24 |
arena_capacity | int64_t | 96 | 8 |
stages_completed | uint32_t | 104 | 4 |
attempts | uint32_t | 108 | 4 |
stardust_db_patch_explain
- Size: 88 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
copy_patch | stardust_cost | 0 | 24 |
commit | stardust_cost | 24 | 24 |
total | stardust_cost | 48 | 24 |
arena_capacity | int64_t | 72 | 8 |
stages_completed | uint32_t | 80 | 4 |
reserved | uint32_t | 84 | 4 |
stardust_db_commit_info
- Size: 32 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
status | uint32_t | 0 | 4 |
reserved | uint32_t | 4 | 4 |
transaction | int64_t | 8 | 8 |
facts | int64_t | 16 | 8 |
committed_at_ticks | int64_t | 24 | 8 |
stardust_db_source
- Size: 32 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
kind | uint32_t | 0 | 4 |
reserved | uint32_t | 4 | 4 |
path | stardust_bytes | 8 | 16 |
document | const stardust_document * | 24 | 8 |
stardust_db_live_event
- Size: 32 bytes
- Alignment: 8 bytes
- Versioned header: no
| Field | C type | Offset | Size |
|---|---|---|---|
sequence | int64_t | 0 | 8 |
superseded | int64_t | 8 | 8 |
transaction | int64_t | 16 | 8 |
result | stardust_document * | 24 | 8 |