Types
ParamDescNamed = object name*: string value*: JsonString
- Source Edit
ParamDescRx = object kind*: JsonValueKind param*: JsonString
- Source Edit
ReBatchKind = enum rbkSingle, rbkMany
- Source Edit
ReqRespHeader = object id*: Opt[RequestId]
- Helper type to extract id from message (for example for logging) Source Edit
RequestBatchRx = object case kind*: ReBatchKind of rbkMany: many*: seq[RequestRx2] of rbkSingle: single*: RequestRx2
- Source Edit
RequestId = object case kind*: RequestIdKind of riNull: nil of riNumber: num*: int of riString: str*: string
- Source Edit
RequestIdKind = enum riNull, riNumber, riString
- Source Edit
RequestParamKind = enum rpPositional, rpNamed
- Source Edit
RequestParamsRx = object case kind*: RequestParamKind of rpPositional: positional*: seq[ParamDescRx] of rpNamed: named*: seq[ParamDescNamed]
- Source Edit
RequestParamsTx = object case kind*: RequestParamKind of rpPositional: positional*: seq[JsonString] of rpNamed: named*: seq[ParamDescNamed]
- Source Edit
RequestRx {....deprecated: "ResultsRx2".} = object jsonrpc*: Opt[JsonRPC2] params*: RequestParamsRx id*: RequestId
- Source Edit
RequestRx2 = object jsonrpc*: JsonRPC2 params*: RequestParamsRx id*: Opt[RequestId]
- Source Edit
ResponseError = object code*: int message*: string data*: Opt[JsonString]
- Source Edit
ResponseKind = enum rkError, rkResult
- Source Edit
ResponseRx {....deprecated.} = object jsonrpc*: Opt[JsonRPC2] id*: Opt[RequestId] result*: JsonString error*: Opt[ResponseError]
- Source Edit
ResponseRx2 = object jsonrpc*: JsonRPC2 case kind*: ResponseKind of rkResult: result*: JsonString of rkError: error*: ResponseError id*: RequestId
- Source Edit
ResponseTx = object jsonrpc*: JsonRPC2 case kind* {.dontSerialize.}: ResponseKind of rkResult: result*: JsonString of rkError: error*: ResponseError id*: RequestId
- Source Edit
Procs
func isFieldExpected(_: type RequestParamsRx): bool {.compileTime, ...raises: [], gcsafe.}
- Source Edit
func meth(rx: RequestRx | RequestRx2): string {....raises: [], gcsafe.}
- Source Edit
proc readValue(r: var JsonReader; value: var Opt[RequestId]) {. ...raises: [IOError, SerializationError], raises: [], gcsafe.}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var JsonRPC2) {....gcsafe, raises: [IOError, JsonReaderError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var RequestBatchRx) {....gcsafe, raises: [IOError, SerializationError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var RequestId) {....gcsafe, raises: [IOError, JsonReaderError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var RequestParamsRx) {....gcsafe, raises: [IOError, SerializationError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var ResponseRx) {....gcsafe, raises: [IOError, SerializationError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc readValue(r: var JsonReader[JrpcSys]; val: var ResponseRx2) {....gcsafe, raises: [IOError, SerializationError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
func toTx(params: RequestParamsRx): RequestParamsTx {....raises: [], gcsafe, tags: [], forbids: [].}
- Source Edit
func typeAutoSerialize(F: type JrpcSys; TM: distinct type): bool {.compileTime, ...raises: [], gcsafe.}
- Check if a type has automatic serialization flag. Source Edit
func typeClassOrMemberAutoSerialize(F: type JrpcSys; TC: distinct type; TM: distinct type): bool {.compileTime, ...raises: [], gcsafe.}
- Check whether a type or its parent type class have automatic serialization flag. Source Edit
proc writeValue(w: var JsonWriter[JrpcSys]; val: JsonRPC2) {....gcsafe, raises: [IOError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc writeValue(w: var JsonWriter[JrpcSys]; val: RequestId) {....gcsafe, raises: [IOError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
proc writeValue(w: var JsonWriter[JrpcSys]; val: RequestParamsTx) {....gcsafe, raises: [IOError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
- Source Edit
Templates
template automaticBuiltinSerialization(F: type JrpcSys; enable: static[bool]) {..}
- Enable or disable all builtin serialization. Source Edit
template automaticPrimitivesSerialization(F: type JrpcSys; enable: static[bool]) {..}
- Set all supported primitives automatic serialization flag. Source Edit
template automaticSerialization(F: type JrpcSys; T: distinct type; enable: static[bool]) {..}
- Set a single type's automatic serialization flag. Source Edit
template flavorAllowsUnknownFields(T: type JrpcSys): bool {..}
- Source Edit
template flavorEnumRep(T: type JrpcSys): EnumRepresentation {..}
- Source Edit
template flavorEnumRep(T: type JrpcSys; rep: static[EnumRepresentation]) {..}
- Source Edit
template flavorOmitsOptionalFields(T: type JrpcSys): bool {..}
- Source Edit
template flavorRequiresAllFields(T: type JrpcSys): bool {..}
- Source Edit
template flavorSkipNullFields(T: type JrpcSys): bool {..}
- Source Edit
template flavorUsesAutomaticObjectSerialization(T: type JrpcSys): bool {..}
- Source Edit
template PreferredOutputType(T`gensym1: type JrpcSys): type {..}
- Source Edit
template readValue(r`gensym10: var Reader(JrpcSys); value`gensym10: var TT`gensym10) {..}
- Source Edit
template shouldWriteObjectField(field: RequestParamsTx): bool {..}
- Source Edit
template withWriter(_: type JrpcSys; writer, body: untyped): seq[byte] {..}
- Source Edit
template writeNotification(writer: var JrpcSys.Writer; name: string; params: RequestParamsTx) {..}
- Source Edit
template writeRequest(writer: var JrpcSys.Writer; name: string; params: RequestParamsTx; id: int) {..}
- Source Edit
template writeValue(w`gensym18: var Writer(JrpcSys); value`gensym18: TT`gensym18) {..}
- Source Edit
template writeValue(w`gensym22: var Writer(JrpcSys); value`gensym22: TT`gensym22) {..}
- Source Edit
template writeValue(w`gensym26: var Writer(JrpcSys); value`gensym26: TT`gensym26) {..}
- Source Edit
template writeValue(w`gensym30: var Writer(JrpcSys); value`gensym30: TT`gensym30) {..}
- Source Edit