json_rpc/private/jrpc_sys

Search:
Group by:
Source   Edit  

Types

BidiMessage = object
  case kind*: BidiMessageKind
  of bmResponse:
    response*: ResponseBatchRx
  of bmRequest:
    request*: RequestBatchRx
Source   Edit  
BidiMessageKind = enum
  bmResponse, bmRequest
Source   Edit  
BidiMessageRequestError = object of SerializationError
Source   Edit  
BidiMessageResponseError = object of SerializationError
Source   Edit  
JrpcSys = object of formatFlavorParent(Json)
Source   Edit  
JsonRPC2 = object
Source   Edit  
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
Deprecated: ResultsRx2
Source   Edit  
RequestRx2 = object
  jsonrpc*: JsonRPC2
  params*: RequestParamsRx
  id*: Opt[RequestId]
Source   Edit  
RequestTx = object
  jsonrpc*: JsonRPC2
  params*: RequestParamsTx
  id*: Opt[RequestId]
Source   Edit  
ResponseBatchRx = object
  case kind*: ReBatchKind
  of rbkMany:
    many*: seq[ResponseRx2]
  of rbkSingle:
    single*: ResponseRx2
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]
Deprecated
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 `$`(x: RequestId): string {....raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
func `==`(a, b: RequestId): bool {....raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
func hash(x: RequestId): hashes.Hash {....raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
func isFieldExpected(_: type RequestParamsRx): bool {.compileTime, ...raises: [],
    gcsafe.}
Source   Edit  
func meth(rx: RequestRx): Opt[string] {....raises: [], gcsafe, tags: [],
                                        forbids: [].}
Source   Edit  
func meth(rx: RequestRx2): string {....raises: [], gcsafe, tags: [], forbids: [].}
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 BidiMessage) {....gcsafe,
    raises: [IOError, SerializationError], raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
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 ResponseBatchRx) {....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 decode(Format: type JrpcSys; inputParam: JsonString; RecordType: type;
                params: varargs[untyped]): auto {..}
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 mimeType(T`gensym1: type JrpcSys): string {..}
Source   Edit  
template PreferredOutputType(T`gensym1: type JrpcSys): type {..}
Source   Edit  
template Reader(T`gensym1: type JrpcSys): type {..}
Source   Edit  
template readValue(r`gensym8: var Reader(JrpcSys); value`gensym8: var TT`gensym8) {..}
Source   Edit  
template readValue(r`gensym12: var Reader(JrpcSys);
                   value`gensym12: var TT`gensym12) {..}
Source   Edit  
template readValue(r`gensym16: var Reader(JrpcSys);
                   value`gensym16: var TT`gensym16) {..}
Source   Edit  
template readValue(r`gensym32: var Reader(JrpcSys);
                   value`gensym32: var TT`gensym32) {..}
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 Writer(T`gensym1: type JrpcSys): type {..}
Source   Edit  
template writeRequest(writer: var JrpcSys.Writer; name: string;
                      params: RequestParamsTx; id: int) {..}
Source   Edit  
template writeValue(w`gensym20: var Writer(JrpcSys); value`gensym20: TT`gensym20) {..}
Source   Edit  
template writeValue(w`gensym24: var Writer(JrpcSys); value`gensym24: TT`gensym24) {..}
Source   Edit  
template writeValue(w`gensym28: var Writer(JrpcSys); value`gensym28: TT`gensym28) {..}
Source   Edit  
template writeValue(w`gensym32: var Writer(JrpcSys); value`gensym32: TT`gensym32) {..}
Source   Edit