Complete reference table for all TeaLeaf types, their text syntax, binary encoding, and language mappings.
TeaLeaf Type Text Syntax Binary Code Binary Size Rust Type C# Type
booltrue / false0x011 byte boolbool
int8420x021 byte i8sbyte
int1610000x032 bytes i16short
int / int321000000x044 bytes i32int
int6450000000000x058 bytes i64long
uint82550x061 byte u8byte
uint16655350x072 bytes u16ushort
uint / uint321000000x084 bytes u32uint
uint64184467440737095516150x098 bytes u64ulong
float323.140x0A4 bytes f32float
float / float643.140x0B8 bytes f64double
string"hello" / hello0x104 bytes (index) Stringstring
bytesb"cafef00d"0x11varint + data Vec<u8>byte[]
json_number(from JSON) 0x124 bytes (index) Stringstring
timestamp2024-01-15T10:30:00Z0x3210 bytes (i64, i16)DateTimeOffset
TeaLeaf Type Text Syntax Binary Code Description
null~ or null0x00Null/missing value
In @table tuples, ~ indicates an absent field (dropped for nullable fields) while null indicates an explicit null (always preserved). In the binary format, these map to two-bit field state codes: 2 (absent) and 1 (explicit null) respectively. See Schemas for details.
TeaLeaf Type Text Syntax Binary Code Description
Array [1, 2, 3]0x20Ordered collection
Object {key: value}0x21String-keyed map
Struct (val, val, ...) in @table0x22Schema-typed record
Map @map {key: value}0x23Any-keyed ordered map
Tuple (val, val, ...)0x24 (reserved)Currently parsed as array
TeaLeaf Type Text Syntax Binary Code Description
Ref !name0x30Named reference
Tagged :tag value0x31Discriminated value
Modifier Syntax Description
Nullable type?Field can be ~ (null)
Array []typeArray of the given type
Nullable array []type?The field itself can be null
int8 → int16 → int32 → int64
uint8 → uint16 → uint32 → uint64
float32 → float64
Widening is automatic when reading binary data. Narrowing requires recompilation.
TeaLeaf Type JSON Output JSON Input
Null nullnull → Null
Bool true/falseboolean → Bool
Int number integer → Int
UInt number large integer → UInt
Float number decimal → Float
String "text"string → String
Bytes "0xhex"(not auto-detected)
JsonNumber number large/precise number → JsonNumber
Timestamp "ISO 8601"(not auto-detected)
Array [...]array → Array
Object {...}object → Object
Map [[k,v],...](not auto-detected)
Ref {"$ref":"name"}(not auto-detected)
Tagged {"$tag":"t","$value":v}(not auto-detected)