Package-level declarations

Types

Link copied to clipboard
data class JSONRPCError<out D>(val code: Int, val message: String, val data: D? = null)

Represents a JSON-RPC 2.0 error object.

Link copied to clipboard

DSL builder for constructing JSONRPCError instances.

Link copied to clipboard

Base type for JSON-RPC 2.0 messages sent from client to server.

Link copied to clipboard

Content-based polymorphic serializer for JSONRPCMessage.

Link copied to clipboard
data class JSONRPCNotification<out P>(val method: String, val params: P? = null) : JSONRPCMessage<P>

A JSON-RPC 2.0 notification — a request without an id field.

Link copied to clipboard
data class JSONRPCRequest<out P>(val id: RequestId?, val method: String, val params: P? = null) : JSONRPCMessage<P>

A JSON-RPC 2.0 request that expects a response from the server.

Link copied to clipboard

Represents a JSON-RPC 2.0 response.

Link copied to clipboard

DSL builder for constructing JSONRPCResponse instances.

Link copied to clipboard
class JSONRPCResponseSerializer<T, E>(resultSerializer: KSerializer<T>, errorDataSerializer: KSerializer<E>) : KSerializer<JSONRPCResponse<T, E>>

Content-based polymorphic serializer for JSONRPCResponse.

Link copied to clipboard

Serializer for nullable RequestId?.

Link copied to clipboard

Represents a JSON-RPC 2.0 request identifier.

Link copied to clipboard

Serializer for non-nullable RequestId.

Link copied to clipboard

A JSONRPCResponse with untyped result and error data, deserialized as raw JsonElement.

Functions

Link copied to clipboard
inline fun <D> jsonRPCError(init: JSONRPCErrorBuilder<D>.() -> Unit): JSONRPCError<D>

Creates a JSONRPCError using the DSL builder.

Link copied to clipboard

Creates a JSONRPCResponse using the DSL builder.

@JvmName(name = "jsonRPCResponseResult")
inline fun <T> jsonRPCResponse(init: JSONRPCResponseBuilder<T, Nothing>.() -> Unit): JSONRPCResponse<T, Nothing>

Creates a JSONRPCResponse using the DSL builder, with error data type defaulting to Nothing.

Link copied to clipboard
fun RequestId(value: Int): RequestId

Creates a RequestId from an Int value.

fun RequestId(value: Long): RequestId

Creates a RequestId from a Long value.

Creates a RequestId from a String value.