Skip to main content

AccessReplicationStateUtils

Reading an AccessReplicationState out of what actually arrived, and asking the one question the combine rules turn on.

Functions

fromEntry

AccessReplicationStateUtils.fromEntry(entry{
valueboolean?,
abstainedboolean?
}?) → string

The state a replicated entry represents.

No entry at all is NOT_YET_ARRIVED; an entry whose value is nil is the server saying it could not answer. Those are different, and telling them apart is the entire reason entries are boxed rather than stored as bare booleans.

hasAnswer

AccessReplicationStateUtils.hasAnswer(statestring) → boolean

Whether the server has said something that may override a local answer. False for both NOT_YET_ARRIVED and ABSTAINED -- silence and "I cannot answer either" both leave the local answer standing.

isReplicationState

AccessReplicationStateUtils.isReplicationState(valueany) → boolean
Show raw api
{
    "functions": [
        {
            "name": "fromEntry",
            "desc": "The state a replicated entry represents.\n\nNo entry at all is `NOT_YET_ARRIVED`; an entry whose `value` is nil is the server saying it could not\nanswer. Those are different, and telling them apart is the entire reason entries are boxed rather\nthan stored as bare booleans.",
            "params": [
                {
                    "name": "entry",
                    "desc": "",
                    "lua_type": "{ value: boolean?, abstained: boolean? }?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 25,
                "path": "src/access/src/Shared/Replication/AccessReplicationStateUtils.lua"
            }
        },
        {
            "name": "hasAnswer",
            "desc": "Whether the server has said something that may override a local answer. False for both\n`NOT_YET_ARRIVED` and `ABSTAINED` -- silence and \"I cannot answer either\" both leave the local answer\nstanding.",
            "params": [
                {
                    "name": "state",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/access/src/Shared/Replication/AccessReplicationStateUtils.lua"
            }
        },
        {
            "name": "isReplicationState",
            "desc": "",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 55,
                "path": "src/access/src/Shared/Replication/AccessReplicationStateUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "AccessReplicationStateUtils",
    "desc": "Reading an [AccessReplicationState] out of what actually arrived, and asking the one question the\ncombine rules turn on.",
    "source": {
        "line": 8,
        "path": "src/access/src/Shared/Replication/AccessReplicationStateUtils.lua"
    }
}