Skip to main content

BindableEncodingUtils

Encodes and decodes arguments so they can survive a trip through a BindableEvent or BindableFunction. Roblox copies tables sent over a bindable and rejects functions and userdata outright, so those values are wrapped in a closure which the receiving side calls to retrieve the original reference.

Functions

encode

BindableEncodingUtils.encode(...any) → ...any

Encodes arguments for transfer over a bindable. Namely this will convert any table into a closure so the receiver gets the original value instead of a copy.

encodeCallback

BindableEncodingUtils.encodeCallback(callbackfunction) → ()

Encodes a given callback so it can be assigned to a BindableFunction

invokeEncodedBindableFunction

BindableEncodingUtils.invokeEncodedBindableFunction(
bindableFunctionBindableFunction,
...any
) → any

Invokes a BindableFunction with encoded arguments and decodes the results.

decode

BindableEncodingUtils.decode(...any) → ...any

Decodes arguments encoded by BindableEncodingUtils.encode.

Show raw api
{
    "functions": [
        {
            "name": "encode",
            "desc": "Encodes arguments for transfer over a bindable. Namely this will convert any\ntable into a closure so the receiver gets the original value instead of a copy.",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "... any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/bindable-utils/src/Shared/BindableEncodingUtils.lua"
            }
        },
        {
            "name": "encodeCallback",
            "desc": "Encodes a given callback so it can be assigned to a BindableFunction",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/bindable-utils/src/Shared/BindableEncodingUtils.lua"
            }
        },
        {
            "name": "invokeEncodedBindableFunction",
            "desc": "Invokes a BindableFunction with encoded arguments and decodes the results.",
            "params": [
                {
                    "name": "bindableFunction",
                    "desc": "",
                    "lua_type": "BindableFunction"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 61,
                "path": "src/bindable-utils/src/Shared/BindableEncodingUtils.lua"
            }
        },
        {
            "name": "decode",
            "desc": "Decodes arguments encoded by [BindableEncodingUtils.encode].",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "... any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 72,
                "path": "src/bindable-utils/src/Shared/BindableEncodingUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BindableEncodingUtils",
    "desc": "Encodes and decodes arguments so they can survive a trip through a\nBindableEvent or BindableFunction. Roblox copies tables sent over a bindable\nand rejects functions and userdata outright, so those values are wrapped in a\nclosure which the receiving side calls to retrieve the original reference.",
    "source": {
        "line": 10,
        "path": "src/bindable-utils/src/Shared/BindableEncodingUtils.lua"
    }
}