AbstractBindingDefDSL

izumi.distage.model.definition.dsl.AbstractBindingDefDSL
See theAbstractBindingDefDSL companion object
trait AbstractBindingDefDSL[BindDSL[_], BindDSLAfterFrom[_], SetDSL[_]] extends AbstractBindingDefDSLMacro[BindDSL]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
AbstractBindingDefDSL[BindDSL, BindDSLAfterFrom, SetDSL]

Members list

Concise view

Type members

Classlikes

final class MutationContext

Use this to create utility functions that add bindings mutably to the current module, as opposed to creating new modules and including them.

Use this to create utility functions that add bindings mutably to the current module, as opposed to creating new modules and including them.

Example:

 import distage.{ClassConstructor, Tag, ModuleDef}
 import izumi.distage.model.definition.dsl.ModuleDefDSL

 trait RegisteredComponent
 class RegisteredComponentImpl extends RegisteredComponent

 def addAndRegister[T <: RegisteredComponent: Tag: ClassConstructor](implicit mutateModule: ModuleDefDSL#MutationContext): Unit = {
   new mutateModule.dsl {
     make[T]

     many[RegisteredComponent]
       .weak[T]
   }
 }

 new ModuleDef {
   addAndRegister[RegisteredComponentImpl]
 }

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any