Package-level declarations

Contains Core definitions of for configuring and constructing ksrpc services and stubs.

Contains Core definitions of for configuring and constructing ksrpc services and stubs.

Contains Core definitions of for configuring and constructing ksrpc services and stubs.

Contains Core definitions of for configuring and constructing ksrpc services and stubs.

Types

Link copied to clipboard
Link copied to clipboard
fun interface ErrorListener

Interface used for handling any errors that occur during hosting.

Link copied to clipboard
interface KsrpcEnvironment<T>

Global configuration for KSRPC channels and services.

Link copied to clipboard
Link copied to clipboard
interface Logger
Link copied to clipboard

Thrown when an endpoint cannot be found. Could happen from version mismatch or other programmer errors.

Link copied to clipboard
class RpcMethod<T : RpcService, I, O>

A wrapper around calling into or from stubs/serialization.

Link copied to clipboard
interface RpcObject<T : RpcService>

Interface for generated companions of RpcService.

Link copied to clipboard
annotation class RpcObjectKey(val rpcObject: KClass<out RpcObject<*>>)

Used to find RpcObject of services in js implementations.

annotation class RpcObjectKey(val rpcObject: KClass<out RpcObject<*>>)

Used to find RpcObject of services in native implementations.

Link copied to clipboard

Used for implementations of SuspendCloseable that need observers attached to be notified when SuspendCloseable.close is called.

Properties

Link copied to clipboard
Link copied to clipboard
const val ERROR_PREFIX: String

Functions

Link copied to clipboard
fun ksrpcEnvironment(stringFormat: StringFormat = Json, builder: KsrpcEnvironmentBuilder<String>.() -> Unit): KsrpcEnvironment<String>
Link copied to clipboard

Convenience method for easily creating a copy of KsrpcEnvironment with a local error listener.

Link copied to clipboard

Creates a copy of the KsrpcEnvironment provided and allows changes to it before returning it. This method does NOT modify the original KsrpcEnvironment.

Link copied to clipboard
expect inline fun <T : RpcService> rpcObject(): RpcObject<T>

Helper to get RpcObject for a given RpcService

actual inline fun <T : RpcService> rpcObject(): RpcObject<T>
actual inline fun <T : RpcService> rpcObject(): RpcObject<T>
actual inline fun <T : RpcService> rpcObject(): RpcObject<T>
Link copied to clipboard

Convert a T into a SerializedService for hosting.

Link copied to clipboard
inline fun <T : RpcService, S> SerializedService<S>.toStub(): T

Convert a SerializedService to a T for use as a client.

Link copied to clipboard
inline suspend fun <T : SuspendCloseable, R> T.use(usage: (T) -> R): R

Helper that runs usage then invokes SuspendCloseable.close in the finally block.