Skip to main content

TableToBuffer

Contains functions exposed to users of this library

Functions

GetSerializerForTable

TableToBuffer.GetSerializerForTable(
tT--

The table to make a binary serializer for

) → Serializer<T>--

A serializer that can make the given table into a buffer

Automatically creates a binary serializer for a given table. Only string-keyed tables are allowed.

Errors

TypeDescription
"This function only accepts tables" when argument t is not a table
"Only maps of { [string]: boolean | number | string | table | vector (Vector3) | buffer } are supported. Mixed tables are not supported, neither are arrays." When the given map contains keys that are not only strings or contains non-primitive data types as values.

TableAsBuffer

TableToBuffer.TableAsBuffer(
tblT--

The table to represent as a buffer.

) → T--

A table with its __index metatable modified so that indexes access the buffer to write and read data.

Generates a buffer for a given table. This will cause the table to be just a metatable into the buffer. Making all the data inside the buffer, and the table just a way to mutate it.

Errors

TypeDescription
"This function does not support arrays or mixed tables."The table can only contain strings.

GetDeserializerBuilder

TableToBuffer.GetDeserializerBuilder() → SerializerBuilder--

A builder that allows you to create a Serializable using a builder-style API

Gets a Serializer/Deserializer builder.

Show raw api
{
    "functions": [
        {
            "name": "GetSerializerForTable",
            "desc": "Automatically creates a binary serializer for a given table. Only string-keyed tables are allowed.",
            "params": [
                {
                    "name": "t",
                    "desc": "The table to make a binary serializer for",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "A serializer that can make the given table into a buffer",
                    "lua_type": "Serializer<T>"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"This function only accepts tables\" when argument t is not a table",
                    "desc": ""
                },
                {
                    "lua_type": "\"Only maps of { [string]: boolean | number | string | table | vector (Vector3) | buffer } are supported. Mixed tables are not supported, neither are arrays.\" When the given map contains keys that are not only strings or contains non-primitive data types as values.",
                    "desc": ""
                }
            ],
            "source": {
                "line": 21,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "TableAsBuffer",
            "desc": "Generates a buffer for a given table. This will cause the table to be just a metatable into the buffer. Making all the data inside the buffer, and the table just a way to mutate it.",
            "params": [
                {
                    "name": "tbl",
                    "desc": "The table to represent as a buffer.",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "A table with its __index metatable modified so that indexes access the buffer to write and read data.",
                    "lua_type": "T"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"This function does not support arrays or mixed tables.\"",
                    "desc": "The table can only contain strings."
                }
            ],
            "source": {
                "line": 69,
                "path": "lib/init.luau"
            }
        },
        {
            "name": "GetDeserializerBuilder",
            "desc": "Gets a Serializer/Deserializer builder.",
            "params": [],
            "returns": [
                {
                    "desc": "A builder that allows you to create a Serializable using a builder-style API",
                    "lua_type": "SerializerBuilder"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 180,
                "path": "lib/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "TableToBuffer",
    "desc": "Contains functions exposed to users of this library",
    "source": {
        "line": 9,
        "path": "lib/init.luau"
    }
}