with

abstract fun <T : Any> with(key: CodecContext.Key<T>, value: T): EncodeContext

Returns a new EncodeContext with key set to value. Does not modify this context — contexts are immutable.