Codec Context
interface CodecContext
Base interface for typed key-value context that flows through codec chains.
Keys defined on CodecContext are accessible in both DecodeContext and EncodeContext, useful for shared configuration like protocol version or byte order.
data object VersionKey : CodecContext.Key<Int>()
// Works in both directions
val dCtx = DecodeContext.Empty.with(VersionKey, 2)
val eCtx = EncodeContext.Empty.with(VersionKey, 2)Content copied to clipboard