Package-level declarations

Types

Link copied to clipboard
class ByteReadChannelBinaryData(channel: ByteReadChannel, val size: Long? = null) : RpcBinaryData

Bridge from ktor's ByteReadChannel onto the transport-agnostic RpcBinaryData interface. Lives here (rather than in ksrpc-core) so that ksrpc-core does not publicly depend on ktor — consumers opt in to the ktor-io adapter by adding ksrpc-binary-ktor to their classpath.

Link copied to clipboard

Compiler-plugin target for ByteReadChannel parameters. Adapts ktor's ByteReadChannel onto the transport-agnostic RpcBinaryData surface used by ksrpc-core's BinaryTransformer.

Functions

Link copied to clipboard
fun RpcBinaryData.asByteReadChannel(scope: CoroutineScope = CoroutineScope(Dispatchers.Default)): ByteReadChannel

Expose an RpcBinaryData as a ByteReadChannel. Unwraps directly when the underlying data is already a ByteReadChannelBinaryData; otherwise spins up a pump coroutine that drains RpcBinaryData.transferTo into a new ktor ByteChannel.

Link copied to clipboard
fun ByteReadChannel.asRpcBinaryData(size: Long? = null): RpcBinaryData

Wrap a ByteReadChannel as an RpcBinaryData.