pub enum Value {
Nil,
Bool(bool),
Number(f64),
Str(Vec<u8>),
Table(Table),
Function(Func),
Global(Global),
}Expand description
A Lua value.
Numbers are f64, matching Lua’s default number type. Strings hold raw
bytes because Lua strings are byte sequences and may contain NUL or other
control characters. Tables are shared handles so two references to the same
table compare equal by identity.
Equality follows Lua. Scalars compare by value. NaN is not equal to itself.
Tables, functions, and globals compare by identity, not by contents.
Variants§
Nil
Lua nil.
Bool(bool)
Lua boolean.
Number(f64)
Lua number. Serialized with numformat, or as 1/0, -1/0, 0/0 for
the special values.
Str(Vec<u8>)
Lua string, stored as raw bytes.
Table(Table)
Lua table with an array part and a hash part.
Function(Func)
A Lua function. Held opaquely by an identity id. The serializer emits a
bytecode-reload stub or, under nocode, an empty body.
Global(Global)
A value known by a global name, such as print or io.stdin. The
serializer emits the name verbatim.