JsonRPC.Response (JsonRPC v0.1.0) View Source
Representation of a JsonRPC response. The JsonRPC version is always "2.0"
.
Examples
iex> JsonRPC.Response.cast(id: 42, result: true)
{:ok, %JsonRPC.Response{id: 42, jsonrpc: "2.0", result: true}}
Link to this section Summary
Functions
Converts the given data
according to the defined schema.
Converts the given data
according to the defined schema.
Returns true if the given data
valid against the defined schema,
otherwise false.
Validates the given data
against the defined schema.
Validates the given data
against the defined schema.
Link to this section Functions
Specs
cast(term()) :: {:ok, term()} | {:error, Xema.ValidationError.t() | Xema.CastError.t()}
Converts the given data
according to the defined schema.
Returns an :ok
tuple with the converted data for valid data
, otherwise
an :error
tuple is returned.
Specs
Converts the given data
according to the defined schema.
Returns converted data for valid data
, otherwise a Xeam.CastError
or
Xema.ValidationError
is raised.
Specs
Returns true if the given data
valid against the defined schema,
otherwise false.
Specs
validate(term()) :: :ok | {:error, Xema.ValidationError.t()}
Validates the given data
against the defined schema.
Returns :ok
for valid data, otherwise an :error
tuple.
Specs
validate!(term()) :: :ok
Validates the given data
against the defined schema.
Returns :ok
for valid data, otherwise a Xema.ValidationError
is
raised.