trait LocatorDef extends AbstractLocator with AbstractBindingDefDSL[BindDSL, BindDSLUnnamedAfterFrom, SetDSL]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LocatorDef
  2. AbstractBindingDefDSL
  3. AbstractLocator
  4. Locator
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def _initialState: ArrayBuffer[BindingRef]
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  5. final def _make[T](provider: Functoid[T])(implicit arg0: Tag[T], pos: CodePositionMaterializer): BindDSL[T]
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  6. def _registered[T <: BindingRef](bindingRef: T): T
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  7. final def addImplicit[T](implicit arg0: Tag[T], instance: T, pos: CodePositionMaterializer): BindDSLUnnamedAfterFrom[T]

    Same as make[T].from(implicitly[T]) *

    Same as make[T].from(implicitly[T]) *

    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  8. final def allInstances: Seq[IdentifiedRef]

    returns

    ALL instances contained in this locator and in all the parent locators, including injector bootstrap environment. Returned keys may overlap if parent locators contain objects for the same key. Instances from parent locators will be earlier in the list than instances from this locator.

    Definition Classes
    Locator
    See also

    izumi.distage.bootstrap.BootstrapLocator

  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def finalizers[F[_]](implicit arg0: TagK[F]): Seq[Finalizer[F]]
    Definition Classes
    LocatorDefLocator
  14. final def find[T](id: Identifier)(implicit arg0: Tag[T]): Option[T]
    Definition Classes
    AbstractLocatorLocator
  15. final def find[T](implicit arg0: Tag[T]): Option[T]
    Definition Classes
    AbstractLocatorLocator
  16. final def get[T](id: Identifier)(implicit arg0: Tag[T]): T
    Definition Classes
    AbstractLocatorLocator
  17. final def get[T](implicit arg0: Tag[T]): T
    Definition Classes
    AbstractLocatorLocator
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def index: Map[DIKey, Any]

    returns

    *Only* instances directly contained in this Locator, *NOT* instances in its parent Locators. Returned keys will be unique.

    Definition Classes
    LocatorDefLocator
  21. def initialState: ArrayBuffer[BindingRef]
    Attributes
    protected
  22. def instances: Seq[IdentifiedRef]

    Objects in this locator in order of creation

    Objects in this locator in order of creation

    returns

    *Only* instances directly contained in this Locator, *NOT* instances in its parent Locators. Returned keys will be unique.

    Definition Classes
    LocatorDefLocator
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. final def lookupInstance[T](key: DIKey)(implicit arg0: Tag[T]): Option[T]
    Definition Classes
    AbstractLocatorLocator
  25. final def lookupInstanceOrThrow[T](key: DIKey)(implicit arg0: Tag[T]): T
    Definition Classes
    AbstractLocatorLocator
  26. def lookupLocalUnsafe(key: DIKey): Option[Any]
    Attributes
    protected
    Definition Classes
    LocatorDefAbstractLocator
  27. final def lookupRef[T](key: DIKey)(implicit arg0: Tag[T]): Option[TypedRef[T]]
    Definition Classes
    AbstractLocatorLocator
  28. final def lookupRefOrThrow[T](key: DIKey)(implicit arg0: Tag[T]): TypedRef[T]
    Definition Classes
    AbstractLocatorLocator
  29. final macro def make[T]: BindDSL[T]
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  30. final def many[T](implicit tag: Tag[Set[T]], pos: CodePositionMaterializer): SetDSL[T]

    Set bindings are useful for implementing event listeners, plugins, hooks, http routes, etc.

    Set bindings are useful for implementing event listeners, plugins, hooks, http routes, etc.

    To define a multibinding use .many and .add methods in ModuleDef DSL:

    import cats.effect._, org.http4s._, org.http4s.dsl.io._, scala.concurrent.ExecutionContext.Implicits.global
    import distage._
    
    object HomeRouteModule extends ModuleDef {
      many[HttpRoutes[IO]].add {
        HttpRoutes.of[IO] { case GET -> Root / "home" => Ok(s"Home page!") }
      }
    }

    Set bindings defined in different modules will be merged together into a single Set. You can summon a created Set by type Set[T]:

    import cats.implicits._, org.http4s.server.blaze._, org.http4s.implicits._
    
    object BlogRouteModule extends ModuleDef {
      many[HttpRoutes[IO]].add {
        HttpRoutes.of[IO] { case GET -> Root / "blog" / post => Ok("Blog post ``$post''!") }
      }
    }
    
    class HttpServer(routes: Set[HttpRoutes[IO]]) {
      val router = routes.foldK
    
      def serve = BlazeBuilder[IO]
        .bindHttp(8080, "localhost")
        .mountService(router, "/")
        .start
    }
    
    val objects = Injector().produce(HomeRouteModule ++ BlogRouteModule)
    val server = objects.get[HttpServer]
    
    val testRouter = server.router.orNotFound
    
    testRouter.run(Request[IO](uri = uri("/home"))).flatMap(_.as[String]).unsafeRunSync
    // Home page!
    
    testRouter.run(Request[IO](uri = uri("/blog/1"))).flatMap(_.as[String]).unsafeRunSync
    // Blog post ``1''!
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
    See also

    Guice wiki on Multibindings: https://github.com/google/guice/wiki/Multibindings

  31. def meta: LocatorMeta
    Definition Classes
    LocatorDefLocator
  32. final def modify[T]: ModifyDSL[T, BindDSL, BindDSLUnnamedAfterFrom, SetDSL]

    Modify a value bound at T.

    Modify a value bound at T. Modifiers stack and are all applied before T is added to the object graph; only the final instance is observable.

    import distage.{Injector, ModuleDef}
    
    Injector().produceGet[Int](new ModuleDef {
      make[Int].from(1)
      modify[Int](_ + 1)
      modify[Int](_ + 1)
    }).use(i => println(s"Got `Int` $i"))
    // Got `Int` 3

    You can also modify while summoning additional dependencies:

    modify[Int]("named").by(_.flatAp {
      (adder: Adder, multiplier: Multiplier) =>
        int: Int =>
          multiplier.multiply(adder.add(int, 1), 10)
    })
    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  36. def parent: Option[Locator]
    Definition Classes
    LocatorDefLocator
  37. lazy val plan: OrderedPlan

    The plan that produced this object graph

    The plan that produced this object graph

    Definition Classes
    LocatorDefLocator
  38. final def run[T](function: Functoid[T]): T

    Run function filling all the arguments from the object graph.

    Run function filling all the arguments from the object graph.

    Works similarly to function bindings in izumi.distage.model.definition.ModuleDef.

    objects.run {
      (hellower: Hellower, bye: Byer) =>
        hellower.hello()
        byer.bye()
    }
    Definition Classes
    Locator
    See also

    izumi.distage.model.providers.Functoid

  39. final def runOption[T](function: Functoid[T]): Option[T]

    Same as run but returns None if any of the arguments could not be fulfilled

    Same as run but returns None if any of the arguments could not be fulfilled

    Definition Classes
    Locator
  40. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. final def todo[T](implicit arg0: Tag[T], pos: CodePositionMaterializer): BindDSLUnnamedAfterFrom[T]

    Create a dummy binding that throws an exception with an error message when it's created.

    Create a dummy binding that throws an exception with an error message when it's created.

    Useful for prototyping.

    Attributes
    protected[this]
    Definition Classes
    AbstractBindingDefDSL
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AbstractLocator

Inherited from Locator

Inherited from AnyRef

Inherited from Any

Ungrouped