NBT and the key-value database¶
Section notes in abi.h
§I NBT binary, KvDb (thread-safe), system & server info
Slots¶
nbt_snbt_to_binary¶
| C | |
|---|---|
fmt: 0=disk little-endian, 1=network.
- Call:
api->nbt_snbt_to_binary(snbt, fmt, ctx, sink) - Parameters:
- snbt :
PierStr - fmt :
int32_t - ctx :
void* - sink :
PierBytesSink
- snbt :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 58, counting from 0
- Callers in each binding:
nbt_binary_to_snbt¶
| C | |
|---|---|
- Call:
api->nbt_binary_to_snbt(data, len, fmt, ctx, sink) - Parameters:
- data :
uint8_t const* - len :
size_t - fmt :
int32_t - ctx :
void* - sink :
PierStrSink
- data :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 59, counting from 0
- Callers in each binding:
kvdb_open¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_open(mod, path, create_if_missing) - Parameters:
- mod :
PierModHandle - path :
PierStr - create_if_missing :
bool
- mod :
- Return type:
PierKvDbHandle - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 60, counting from 0
- Callers in each binding:
- Rust:
KvDb::open,KvDb::open_existing - Go:
OpenKvDb,Raw.KvdbOpen
- Rust:
kvdb_close¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_close(h) - Parameters:
- h :
PierKvDbHandle
- h :
- Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 61, counting from 0
- Callers in each binding:
- Go:
KvDb.Close,Raw.KvdbClose
- Go:
kvdb_get¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_get(h, key, ctx, sink) - Parameters:
- h :
PierKvDbHandle - key :
PierStr - ctx :
void* - sink :
PierStrSink
- h :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 62, counting from 0
- Callers in each binding:
- Rust:
KvDb::try_get,KvDb::get - Go:
KvDb.Get,Raw.KvdbGet
- Rust:
kvdb_set¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_set(h, key, value) - Parameters:
- h :
PierKvDbHandle - key :
PierStr - value :
PierStr
- h :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 63, counting from 0
- Callers in each binding:
- Rust:
KvDb::set - Go:
KvDb.Set,Raw.KvdbSet
- Rust:
kvdb_del¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_del(h, key) - Parameters:
- h :
PierKvDbHandle - key :
PierStr
- h :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 64, counting from 0
- Callers in each binding:
- Rust:
KvDb::del - Go:
KvDb.Delete,Raw.KvdbDel
- Rust:
kvdb_has¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_has(h, key) - Parameters:
- h :
PierKvDbHandle - key :
PierStr
- h :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 65, counting from 0
- Callers in each binding:
- Rust:
KvDb::has,KvDb::has - Go:
KvDb.Has,Raw.KvdbHas
- Rust:
kvdb_is_empty¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_is_empty(h) - Parameters:
- h :
PierKvDbHandle
- h :
- Return type:
bool - Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 66, counting from 0
- Callers in each binding:
- Rust:
KvDb::is_empty,KvDb::is_empty - Go:
KvDb.IsEmpty,Raw.KvdbIsEmpty
- Rust:
kvdb_iter¶
| C | |
|---|---|
Group note
KvDb: THREAD-SAFE (internal mutex). Paths are confined to the mod's own data directory; ".." and absolute paths are rejected. Handles are owned by the loader and force-closed (with a warning) at mod unload.
- Call:
api->kvdb_iter(h, ctx, sink) - Parameters:
- h :
PierKvDbHandle - ctx :
void* - sink :
PierKvSink
- h :
- Section of abi.h: §I NBT binary, KvDb (thread-safe), system & server info
- Position in the table: slot 67, counting from 0
- Callers in each binding:
- Rust:
KvDb::iter,KvDb::iter - Go:
KvDb.Iter
- Rust:
Types¶
PierBytesSink¶
| C | |
|---|---|
Raw byte sink (binary NBT). Bytes valid only within the call frame.
PierKvSink¶
| C | |
|---|---|
Key/value sink (kvdb_iter). Views valid only within the call frame.
PierKvDbHandle¶
| C | |
|---|---|
Opaque handle to an open key-value database owned by the loader.