with

infix inline fun <C : Any, A : Any, T : Any> TypeBinderSubTypes<T>.with(noinline block: (TypeToken<out T>) -> <Error class: unknown class><in C, in A, out T>)

Allows to define a binding that will be called for any subtype of this type.

First part of the bind<Type>().subTypes() with { type -> binding } syntax.

Parameters

T

The parent type.

block

A function that will give the binding for the provided sub-type.

infix inline fun <T : Any> DI.Builder.ConstantBinder.with(value: T)

Binds the previously given tag to the given instance.

T generics will be erased!

Parameters

T

The type of value to bind.

value

The instance to bind.