def head.id

ezmcp@0.1.0.0 · src/rpc.bend:119

import ezmcp@0.1.0.0/src/rpc.bend as Rpc
import Base
import emerging-ezjson@1.2.0.0/main.bend as Json
import emerging-ezjson@1.2.0.0/src/value.bend as Value

119# the id an error reply to a message carries: its own when it has a valid
120# one, null otherwise (JSON-RPC 2.0 §5)
121def head.id(has_id: Bool, id_ok: Bool, id: Value.Json) -> Value.Json:
122  Bool.pick(Value.Json, Bool.and(has_id, id_ok), id, Json.null())

Uses (5)

Used by (2)