Packages
This is implementation of transport agnostic JSONRPC 2.0 protocol. There is no transport level. It consists only of specification entities
Current section
Files
Jump to
Current section
Files
lib/jsonrpc2/spec/result.ex
defmodule JSONRPC2.Spec.Result do
@moduledoc """
Struct which represents JSONRPC result.
"""
alias JSONRPC2.Spec
@type t :: %__MODULE__{
id: Spec.id(),
result: term(),
jsonrpc: String.t()
}
@derive JSON.Encoder
defstruct [:id, :result, jsonrpc: "2.0"]
@spec new(Spec.id(), term()) :: t()
def new(id, result) do
%__MODULE__{id: id, result: result}
end
end