lite3
| Kind | ffi-zig |
|---|---|
| Categories | parser data-format encoding |
| Keywords | lite3 serialization binary zero-copy json btree |
Lite3 zero-copy serialization format bindings for Kit
Files
| File | Description |
|---|---|
kit.toml | Package manifest with metadata and dependencies |
src/lite3.kit | Key-value store API and JSON conversion |
zig/kit_ffi.zig | Common Kit FFI types and value helpers |
zig/lite3.zig | B-tree storage and JSON serialization |
tests/test-lite3-ffi.kit | FFI context creation and get/set operations |
tests/test-lite3.kit | Lite3Value constructors and type predicates |
Dependencies
No Kit package dependencies.
Installation
kit add gitlab.com/kit-lang/packages/kit-lite3.gitUsage
import Kit.Lite3License
MIT License - see LICENSE for details.
Exported Functions & Types
Lite3Type
Lite3 value types
Variants
Lite3NullLite3BoolLite3IntLite3FloatLite3BytesLite3StringLite3ObjectLite3ArrayLite3Error
Lite3 error type for error handling.
match Lite3.get-str ctx "key"
| Ok value -> println "Value: ${value}"
| Err (Lite3Error { message }) -> println "Error: ${message}"Variants
Lite3Error {message}Lite3Handle
Opaque handle to a Lite3 context. This is an integer ID that references a context in the Zig registry.
Variants
IntLite3Value
Lite3 value - a Kit representation of data stored in Lite3 format.
This type is used for working with Lite3 data in a type-safe way.
Variants
Lite3ValueNullLite3ValueBool {Bool}Lite3ValueInt {Int}Lite3ValueFloat {Float}Lite3ValueBytes {_0}Lite3ValueString {String}Lite3ValueObject {_0}Lite3ValueArray {_0}to-json-value
Converts a Lite3Value to a JSONValue.
Parameters:
Returns:
Lite3Value -> JSONValue
from-json-value
Converts a JSONValue to a Lite3Value.
Parameters:
Returns:
JSONValue -> Lite3Value
is-null?
Checks if value is null.
Lite3Value -> Bool
is-bool?
Checks if value is a boolean.
Lite3Value -> Bool
is-int?
Checks if value is an integer.
Lite3Value -> Bool
is-float?
Checks if value is a float.
Lite3Value -> Bool
is-bytes?
Checks if value is bytes.
Lite3Value -> Bool
is-string?
Checks if value is a string.
Lite3Value -> Bool
is-object?
Checks if value is an object.
Lite3Value -> Bool
is-array?
Checks if value is an array.
Lite3Value -> Bool
null
Creates a null value.
Lite3Value
bool
Creates a boolean value.
Bool -> Lite3Value
int
Creates an integer value.
Int -> Lite3Value
float
Creates a float value.
Float -> Lite3Value
bytes
Creates a bytes value.
[Int] -> Lite3Value
string
Creates a string value.
String -> Lite3Value
object
Creates an object value.
[(String, Lite3Value)] -> Lite3Value
array
Creates an array value.
[Lite3Value] -> Lite3Value