json_rpc/private/jrpc_sys

Search:
Group by:
Source   Edit  

Types

JrpcSys = object of SerializationFormat
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  
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 | 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 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`gensym6: var Reader(JrpcSys); value`gensym6: var TT`gensym6) {..}
Source   Edit  
template readValue(r`gensym10: var Reader(JrpcSys);
                   value`gensym10: var TT`gensym10) {..}
Source   Edit  
template readValue(r`gensym14: var Reader(JrpcSys);
                   value`gensym14: var TT`gensym14) {..}
Source   Edit  
template readValue(r`gensym30: var Reader(JrpcSys);
                   value`gensym30: var TT`gensym30) {..}
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`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