DependencyInitializer

sealed interface DependencyInitializer(source)

Wraps the logic for creating a new instance of a dependency.

Concrete types of this sealed interface are used to include some metadata regarding how they were registered.

Report a problem

Inheritors

Types

Link copied to clipboard

Represents a specific implementation of DependencyInitializer that throws an exception when there are multiple dependencies matching the given key, leading to an ambiguity.

Link copied to clipboard
class Explicit(val key: DependencyKey, init: suspend DependencyResolver.() -> Any?) : DependencyInitializer

An explicit dependency creation function for directly registered types.

Link copied to clipboard

Represents an implicitly registered dependency creation function that delegates to its explicit parent.

Link copied to clipboard

A placeholder that is used when a consumer is able to wait for a dependency provider to supply a true function.

Link copied to clipboard

Represents a no-op or absent dependency initializer.

Link copied to clipboard
data class Value(val key: DependencyKey, val value: Any?) : DependencyInitializer

Represents a value-based dependency initializer, which resolves to a given value.

Properties

Link copied to clipboard
abstract val key: DependencyKey
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun resolve(resolver: DependencyResolver): Deferred<Any?>