Package-level declarations

Types

Link copied to clipboard

Resolved dependencies and locally owned resources for Mosaic.

Link copied to clipboard

Builder for constructing a Canvas with dependency bindings.

Link copied to clipboard

External fallback for keys absent from all explicit Canvas bindings. Install once with CanvasBuilder.dependencyResolver; child layers inherit the same resolver.

Link copied to clipboard

Factory for creating Canvas instances from dependency bindings.

Link copied to clipboard
data class CanvasKey<T : Any>(val type: KClass<T>, val qualifier: String? = null)

The key used to retrieve sources from the canvas

Functions

Link copied to clipboard
suspend fun canvas(parent: Canvas? = null, build: CanvasBuilder.() -> Unit): Canvas

Creates a new Canvas using the canvas DSL.

Inherited functions

Link copied to clipboard
inline fun <T : Any> Canvas.source(qualifier: String? = null): T

Inline extension function to retrieve a dependency using reified type parameters.

Link copied to clipboard
inline fun <T : Any> Canvas.sourceOrNull(qualifier: String? = null): T?

Inline extension function to retrieve a dependency using reified type parameters. Returns null if the source is not found.

Link copied to clipboard
suspend fun <R> Canvas.withMosaic(block: suspend Mosaic.() -> R): R

Executes block with a request-owned Mosaic, inheriting the calling coroutine's context. Tile producers are supervised siblings: cancelling a waiter does not cancel shared work. Request cancellation cancels unfinished producers. Every exit cancels speculative work and waits for producer and attached-child cleanup before returning or propagating the block's failure. Each invocation has a fresh cache. Keep the complete handler inside block; do not retain its Mosaic for later requests. This function does not close this Canvas. Scope a child Canvas separately when it constructs owned resources.