AbstractCoroutineContextKey

constructor(baseKey: CoroutineContext.Key<B>, safeCast: (element: CoroutineContext.Element) -> E?)(source)

Parameters

baseKey

an instance of base key

safeCast

a function that can safely cast abstract CoroutineContext.Element to the concrete E type and return the element if it is a subtype of E or null otherwise.

Type Parameters

B

base class of a polymorphic element

E

element type associated with the current key