json_rpc/client

Search:
Group by:
Source   Edit  

Types

GetJsonRpcRequestHeaders = proc (): seq[(string, string)] {....gcsafe, raises: [].}
Source   Edit  
ResponseFut = Future[seq[byte]].Raising([CancelledError, JsonRpcError])
Source   Edit  
RpcBatchCallRef = ref object of RootRef
  client*: RpcClient
  batch*: seq[RpcBatchItem]
Source   Edit  
RpcBatchItem = object
  meth*: string
  params*: RequestParamsTx
Source   Edit  
RpcBatchResponse = object
  error*: Opt[string]
  result*: JsonString
Source   Edit  
RpcClient = ref object of RootRef
  onDisconnect*: proc () {....gcsafe, raises: [].}
  onProcessMessage* {....deprecated.}: proc (client: RpcClient; line: string): Result[
      bool, string] {....gcsafe, raises: [].}
  remote*: string
  maxMessageSize*: int
Source   Edit  
RpcConnection = ref object of RpcClient
  router*: RpcRouterCallback ## Router used for transports that support bidirectional communication
  pendingRequests*: Deque[ResponseFut]
Source   Edit  
RpcRouterCallback = proc (request: RequestBatchRx): Future[seq[byte]] {.
    async: (...raises: []).}
Source   Edit  

Consts

defaultMaxMessageSize = 134217728
Source   Edit  

Procs

proc call(client: RpcClient; name: string; params: JsonNode): InternalRaisesFuture[
    JsonString, (CancelledError, JsonRpcError)] {....stackTrace: false, raises: [],
    gcsafe, raises: [], gcsafe, tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc call(client: RpcClient; name: string; params: JsonNode;
          Format: type SerializationFormat): InternalRaisesFuture[JsonString,
    (CancelledError, JsonRpcError)] {....stackTrace: false, raises: [], gcsafe,
                                      raises: [], gcsafe.}
Source   Edit  
proc call(client: RpcClient; name: string; params: RequestParamsTx): InternalRaisesFuture[
    JsonString, (CancelledError, JsonRpcError)] {....stackTrace: false, raises: [],
    gcsafe, raises: [], gcsafe, tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc callBatch(client: RpcClient; calls: seq[RequestTx]): InternalRaisesFuture[
    seq[ResponseRx2], (CancelledError, JsonRpcError)] {....stackTrace: false,
    raises: [], gcsafe, raises: [], gcsafe, tags: [RootEffect, WriteIOEffect],
    forbids: [].}
Source   Edit  
proc callOnProcessMessage(client: RpcClient; line: openArray[byte]): Result[
    bool, string] {....raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc clearPending(client: RpcConnection; exc: ref JsonRpcError) {....raises: [],
    gcsafe, tags: [], forbids: [].}
Source   Edit  
func hash(v: RpcClient): Hash {....raises: [], gcsafe, tags: [], forbids: [].}
Source   Edit  
proc json_rpc_workaround_24844_future_string() {.exportc, ...raises: [], gcsafe,
    tags: [], forbids: [].}
Source   Edit  
proc notify(client: RpcClient; name: string; params: RequestParamsTx): InternalRaisesFuture[
    void, (CancelledError, JsonRpcError)] {....stackTrace: false, raises: [],
    gcsafe, raises: [], gcsafe, tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc prepareBatch(client: RpcClient): RpcBatchCallRef {....raises: [], gcsafe,
    tags: [], forbids: [].}
Source   Edit  
proc processMessage(client: RpcConnection; line: seq[byte]): InternalRaisesFuture[
    seq[byte], void] {....stackTrace: false, raises: [], gcsafe, raises: [],
                       gcsafe, tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  
proc processsSingleResponse(body: openArray[byte]; id: int): JsonString {.
    ...raises: [JsonRpcError], raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc send(batch: RpcBatchCallRef): InternalRaisesFuture[
    Result[seq[RpcBatchResponse], string], (CancelledError,)] {.
    ...stackTrace: false, raises: [], gcsafe, raises: [], gcsafe,
    tags: [RootEffect, WriteIOEffect], forbids: [].}
Source   Edit  

Methods

method close(client: RpcClient): InternalRaisesFuture[void, void] {.base,
    ...stackTrace: false, raises: [], gcsafe, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Source   Edit  

Macros

macro createRpcSigs(clientType: untyped; filePath: static[string];
                    formatType: untyped): untyped {..}
Takes a file of forward declarations in Nim and builds them into RPC calls, based on their parameters. Inputs are marshalled to json, and results are put into the signature's Nim type. Source   Edit  
macro createRpcSigsFromNim(clientType, formatType, procList: untyped): untyped {..}
Takes a list of forward declarations in Nim and builds them into RPC calls, based on their parameters. Inputs are marshalled to json, and results are put into the signature's Nim type. Source   Edit  
macro createRpcSigsFromString(clientType: untyped; sigString: static[string];
                              formatType: untyped): untyped {..}
Takes a string of forward declarations in Nim and builds them into RPC calls, based on their parameters. Inputs are marshalled to json, and results are put into the signature's Nim type. Source   Edit  
macro createSingleRpcSig(clientType: untyped; alias: static[string];
                         formatType, procDecl: untyped): untyped {..}
Takes a single forward declarations in Nim and builds them into RPC calls, based on their parameters. Inputs are marshalled to json, and results are put into the signature's Nim type. Source   Edit  

Templates

template createRpcSigs(clientType: untyped; filePath: string): untyped {..}
Source   Edit  
template createRpcSigsFromNim(clientType, procList: untyped): untyped {..}
Source   Edit  
template createRpcSigsFromString(clientType: untyped; sigString: string): untyped {..}
Source   Edit  
template createSingleRpcSig(clientType: untyped; alias: string;
                            procDecl: untyped): untyped {..}
Source   Edit  
template withPendingFut(client, fut, body: untyped): untyped {..}
Source   Edit