Skip to content

Nerixyz/serde-lua-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serde-lua-table

Serialize values in lua representation.

It's basically serde_json but emitting lua tables.

Usage

serde-lua-table = { git = "https://github.com/Nerixyz/serde-lua-table.git", tag = "v0.1.2" }
serde_lua_table::to_string(&value);
serde_lua_table::to_string_pretty(&value);

Example

Using mlua's Value and test_example.lua we get:

{
  [4] = "a",
  ["xd"] = {
    ["array"] = {
      1,
      2,
      3,
      4
    },
    ["forsen"] = 5,
    ["combined"] = {
      0,
      1
    }
  }
}

Note that in combined we also added ["a"] which wasn't serialized, this is because of the Serialize implementation on mlua::Value which didn't include it.

About

Serialize values in lua representation.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors