msgpack
| Kind | kit |
|---|---|
| Categories | encoding data-format serialization |
| Keywords | msgpack messagepack serialization binary encoding |
MessagePack binary serialization for Kit
Files
| File | Description |
|---|---|
kit.toml | Package manifest with metadata and dependencies |
src/msgpack.kit | MessagePack encoding, decoding, and value accessors |
tests/msgpack.test.kit | Tests for all value types and nested structures |
examples/basic.kit | Encode and decode maps, arrays, and nested data |
examples/comparison.kit | Compare MessagePack vs JSON serialization sizes |
LICENSE | MIT license file |
Dependencies
No Kit package dependencies.
Installation
kit add gitlab.com/kit-lang/packages/kit-msgpack.gitUsage
import Kit.MsgpackLicense
MIT License - see LICENSE for details.
Exported Functions & Types
MsgPackError
MsgPack error type for typed error handling.
Variants
MsgPackDecodeError {message}MsgPackFormatError {message}MsgPack
Marker type for the MessagePack format. Used with BinaryEncode/BinaryDecode traits to distinguish MessagePack serialization.
Variants
MsgPackValue
MessagePack value representation
Variants
MsgNilMsgBool {Bool}MsgInt {Int}MsgFloat {Float}MsgString {String}MsgBinary {List, Int}MsgArray {List, Value}MsgMap {List}MsgExt {Int, List, Int}encode
Value -> List Int
decode
List Int -> Result Value MsgPackError
nil
Value
bool
Bool -> Value
int
Int -> Value
float
Float -> Value
string
String -> Value
binary
List Int -> Value
array
List Value -> Value
map
List (String, Value) -> Value
ext
Int -> List Int -> Value
to-bytes
Value -> List Int
from-bytes
List Int -> Result Value MsgPackError
pack
Value -> String
unpack
String -> Result Value MsgPackError
is-nil?
Value -> Bool
is-bool?
Value -> Bool
is-int?
Value -> Bool
is-float?
Value -> Bool
is-string?
Value -> Bool
is-binary?
Value -> Bool
is-array?
Value -> Bool
is-map?
Value -> Bool
is-ext?
Value -> Bool
as-bool
Value -> Option Bool
as-int
Value -> Option Int
as-float
Value -> Option Float
as-string
Value -> Option String
as-binary
Value -> Option (List Int)
as-array
Value -> Option (List Value)
as-map
Value -> Option (List (String, Value))
get
Value -> String -> Option Value
at
Value -> Int -> Option Value