BaseSubserviceTransformer

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.

Introspection consumers pattern-match on this base class to recover the underlying sub-service name regardless of the user-facing adapter shape — e.g. SubserviceTransformer<T> (trivial O == T) and com.monkopedia.ksrpc.flow.FlowSubserviceTransformer<T> (adapts Flow<T> onto KsFlowService<T>) both surface via the same branch.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
abstract val serviceObject: RpcObject<T>
Link copied to clipboard
open val typeArgSerializers: List<KSerializer<*>>

Serializers for the type arguments of the sub-service, in declaration order. For example, FlowSubserviceTransformer<Update> returns the KSerializer<Update>. Non-generic sub-services return an empty list (the default).

Functions

Link copied to clipboard
open suspend override fun <S> transform(input: O, channel: SerializedService<S>): CallData<S>
Link copied to clipboard
open suspend override fun <S> untransform(data: CallData<S>, channel: SerializedService<S>): O