Package-level declarations
Contains KsContextBinding, the interface that bridges a coroutine-context element to and from the wire for @KsContext-annotated methods.
Core types including RpcObject, RpcMethod, KsrpcEnvironment, MethodMetadata, exception types, and service utilities used by generated companions and user code.
IntrospectionService, IntrospectableRpcService, RpcEndpointInfo, RpcDescriptor, RpcDataType, and helpers that derive schema descriptors from KSerializer instances.
Contains KsContextBinding, the interface that bridges a coroutine-context element to and from the wire for @KsContext-annotated methods.
Core types including RpcObject, RpcMethod, KsrpcEnvironment, MethodMetadata, exception types, and service utilities used by generated companions and user code.
IntrospectionService, IntrospectableRpcService, RpcEndpointInfo, RpcDescriptor, RpcDataType, and helpers that derive schema descriptors from KSerializer instances.
Contains KsContextBinding, the interface that bridges a coroutine-context element to and from the wire for @KsContext-annotated methods.
Core types including RpcObject, RpcMethod, KsrpcEnvironment, MethodMetadata, exception types, and service utilities used by generated companions and user code.
IntrospectionService, IntrospectableRpcService, RpcEndpointInfo, RpcDescriptor, RpcDataType, and helpers that derive schema descriptors from KSerializer instances.
Contains KsContextBinding, the interface that bridges a coroutine-context element to and from the wire for @KsContext-annotated methods.
Core types including RpcObject, RpcMethod, KsrpcEnvironment, MethodMetadata, exception types, and service utilities used by generated companions and user code.
IntrospectionService, IntrospectableRpcService, RpcEndpointInfo, RpcDescriptor, RpcDataType, and helpers that derive schema descriptors from KSerializer instances.
Contains KsContextBinding, the interface that bridges a coroutine-context element to and from the wire for @KsContext-annotated methods.
Core types including RpcObject, RpcMethod, KsrpcEnvironment, MethodMetadata, exception types, and service utilities used by generated companions and user code.
IntrospectionService, IntrospectableRpcService, RpcEndpointInfo, RpcDescriptor, RpcDataType, and helpers that derive schema descriptors from KSerializer instances.
Types
Shared abstract base for transformers whose wire representation is a sub-service reference (a channel id registered on the host, resolved to a client stub on the peer). The base holds the register / lookup machinery operating on the service-facing type T; concrete subclasses adapt a (possibly different) user-facing type O to T via toService / fromService.
Marker for transformers whose wire representation is CallData.Binary / RpcBinaryData, regardless of the user-facing type they adapt. Consumers (e.g. introspection, diagnostics) should treat any implementor as "binary payload" rather than enumerating individual adapter objects.
Bridges the user's wire-format T (a JSON string, a JNI Any? graph, etc.) to / from typed values. Implementations are tied to a specific wire format: a StringSerializer round-trips through kotlinx.serialization's string formats, a JniSerialization round-trips through the JNI Any? envelope, and so on.
Interface used for handling any errors that occur during hosting.
Describes one @KsContext-meta-annotated binding captured by the ksrpc compiler plugin on a @KsMethod function or its enclosing @KsService interface. Each entry holds a reference to the KsContextBinding singleton that knows how to encode/decode the context element for wire transport.
Describes one @KsError(code, type) binding captured by the ksrpc compiler plugin on a @KsMethod function. The plugin emits one entry per annotation in declaration order into RpcMethod.errorMappings. Runtime routing (#78) consumes these via the forwardErrorMap / reverseErrorMap helpers on RpcMethod — forward maps for client-side deserialization by incoming wire code, reverse maps for server-side resolution of a thrown data::class back to its code + serializer.
Global configuration for KSRPC channels and services.
Base class for exceptions thrown by the ksrpc runtime.
A typed wrapper for an argument captured into a MethodMetadata.
A captured sibling annotation on a @KsMethod function.
Thrown when an endpoint cannot be found. Could happen from version mismatch or other programmer errors.
Wrapper around exceptions thrown in remote calls.
A wrapper around calling into or from stubs/serialization.
Interface for generated companions of RpcService.
Used to find RpcObject of services in js implementations.
Used to find RpcObject of services in native implementations.
Used to find RpcObject of services in js implementations.
Describes the minimum transport capability a service requires. The compiler plugin sets this on the generated RpcObject companion.
Used for implementations of SuspendCloseable that need observers attached to be notified when SuspendCloseable.close is called.
Adapts a user-facing type to the wire-level CallData representation. Only non-error variants flow through transformers — CallData.Error frames are intercepted by RpcMethod.callChannel and converted to a thrown Throwable via RpcMethod.decodeError before any transformer sees them.
Opt-in fallback for services that want to handle incoming RPC calls targeting method names that are not registered on the service.
Properties
Forward lookup built from RpcMethod.errorMappings: code → mapping. Used by the client-side error-decoder to resolve an incoming wire-level code back to the captured KSerializer for deserializing the payload. Entries from later @KsError annotations that share a code overwrite earlier ones; duplicate codes on a single method are a programming error that transport validation can surface.
Reverse lookup built from RpcMethod.errorMappings: data::class → mapping. Used by the server-side error-encoder to resolve the thrown data::class back to its bound code + captured KSerializer. Later entries overwrite earlier ones for the same type.
Returns the timeout in milliseconds configured via @KsTimeout on the source method, or null if no timeout annotation was present.
Functions
Convenience method for easily creating a copy of KsrpcEnvironment with a local error listener.
Creates a copy of the KsrpcEnvironment provided and allows changes to it before returning it. This method does NOT modify the original KsrpcEnvironment.
Verify that rpcObject's RpcObject.serviceTier is at most maxTier. Throws IllegalArgumentException with a descriptive message if the service exceeds the transport's capability.
Resolve a KSerializer for type via kotlinx.serialization.serializer, converting any SerializationException into an IllegalArgumentException that names the offending service and type. Used by generated RpcObjectFactory.create bodies.
Convert a T into a SerializedService for hosting.
Build an RpcException carrying the stack captured in this RpcFailure.
Convert a SerializedService to a T for use as a client.