Packages

final class MakeNamedDSL[T] extends MakeDSLMutBase[T, MakeNamedDSL[T]] with MakeDSLBase[T, MakeDSLNamedAfterFrom[T]]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MakeNamedDSL
  2. MakeDSLBase
  3. MakeDSLMutBase
  4. Tagging
  5. AddDependencyDSL
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MakeNamedDSL(mutableState: SingletonRef, key: BasicKey)

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 _modifyBy(f: (Functoid[T]) => Functoid[T]): MakeNamedDSL[T]
    Attributes
    protected
    Definition Classes
    MakeDSLMutBaseAddDependencyDSL
  5. def addDependencies(keys: Iterable[DIKey]): MakeNamedDSL[T]
    Definition Classes
    AddDependencyDSL
  6. def addDependency(key: DIKey): MakeNamedDSL[T]
    Definition Classes
    AddDependencyDSL
  7. def addDependency[B](name: Identifier)(implicit arg0: Tag[B]): MakeNamedDSL[T]
    Definition Classes
    AddDependencyDSL
  8. def addDependency[B](implicit arg0: Tag[B]): MakeNamedDSL[T]
    Definition Classes
    AddDependencyDSL
  9. final def addOp[R](op: SingletonInstruction)(newState: (SingletonRef) => R): R
    Attributes
    protected
    Definition Classes
    MakeDSLMutBase
  10. final def aliased[T1 >: T](name: Identifier)(implicit arg0: Tag[T1], pos: CodePositionMaterializer): MakeNamedDSL[T]
    Definition Classes
    MakeDSLMutBase
  11. final def aliased[T1 >: T](implicit arg0: Tag[T1], pos: CodePositionMaterializer): MakeNamedDSL[T]
    Definition Classes
    MakeDSLMutBase
  12. def annotateParameter[P](name: Identifier)(implicit arg0: Tag[P]): MakeNamedDSL[T]
    Definition Classes
    AddDependencyDSL
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def bind(impl: ImplDef): MakeDSLNamedAfterFrom[T]
    Attributes
    protected
    Definition Classes
    MakeNamedDSLMakeDSLBase
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. def confined: MakeNamedDSL[T]
    Definition Classes
    Tagging
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def exposed: MakeNamedDSL[T]
    Definition Classes
    Tagging
  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  21. final def from[I <: T](function: Functoid[I])(implicit d: DummyImplicit): MakeDSLNamedAfterFrom[T]

    A function that receives its arguments from DI object graph, including named instances via izumi.distage.model.definition.Id annotation.

    A function that receives its arguments from DI object graph, including named instances via izumi.distage.model.definition.Id annotation.

    The following syntaxes are supported by extractor macro:

    Inline lambda:

    make[Unit].from {
      i: Int @Id("special") => ()
    }

    Method reference:

    def constructor(@Id("special") i: Int): Unit = ()
    
    make[Unit].from(constructor _)
    
    make[Unit].from(constructor(_))

    Function value with an annotated signature:

    val constructor: (Int @Id("special"), String @Id("special")) => Unit = (_, _) => ()
    
    make[Unit].from(constructor)

    Using intermediate vals will lose annotations when converting a method into a function value, Prefer passing inline lambdas such as { x => y } or method references such as (method _) or (method(_)).:

    def constructorMethod(@Id("special") i: Int): Unit = ()
    
    val constructor = constructorMethod _
    
    make[Unit].from(constructor) // SURPRISE: Will summon regular Int, not a "special" Int from DI object graph
    make[Unit].from(constructorMethod _) // Will work correctly: summon "special" Int

    Prefer annotating parameter types, not parameters: class X(i: Int @Id("special")) { ... }

    case class X(i: Int @Id("special"))
    
    make[X].from(X.apply _) // summons special Int

    Functoid forms an applicative functor via its izumi.distage.model.providers.Functoid.pure & izumi.distage.model.providers.Functoid#map2 methods

    Definition Classes
    MakeDSLBase
    See also

    izumi.distage.reflection.macros.FunctoidMacro]

    Functoid is based on the Magnet Pattern: http://spray.io/blog/2012-12-13-the-magnet-pattern/

    Essentially Functoid is a function-like entity with additional properties, so it's funny name is reasonable enough: https://en.wiktionary.org/wiki/-oid#English

  22. final def from[I <: T](function: => I)(implicit arg0: Tag[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  23. final def from[I <: T](implicit arg0: ClassConstructor[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  24. final def fromEffect[F[_], I <: T](function: Functoid[F[I]])(implicit arg0: TagK[F], arg1: Tag[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  25. final def fromEffect[F[_], I <: T](instance: F[I])(implicit arg0: TagK[F], arg1: Tag[I]): MakeDSLNamedAfterFrom[T]

    Bind to a result of executing a purely-functional effect

    Bind to a result of executing a purely-functional effect

    Example:

    import cats.effect.concurrent.Ref
    import cats.effect.IO
    
    make[Ref[IO, Int]].named("globalMutableCounter").fromEffect(Ref[IO](0))
    Definition Classes
    MakeDSLBase
  26. final def fromFactory[I <: T](implicit arg0: FactoryConstructor[I]): MakeDSLNamedAfterFrom[T]

    Definition Classes
    MakeDSLBase
    See also

    Auto-Factories feature

  27. final def fromResource[R0, R <: Lifecycle[LifecycleF, T]](function: Functoid[R0])(implicit adapt: Aux[R0, R], tag: LifecycleTag[R]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  28. final def fromResource[R](function: Functoid[R with Lifecycle[LifecycleF, T]])(implicit tag: LifecycleTag[R], d: DummyImplicit): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  29. final def fromResource[R](instance: R with Lifecycle[LifecycleF, T])(implicit tag: LifecycleTag[R]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  30. final def fromResource[R <: Lifecycle[LifecycleF, T]](implicit arg0: ClassConstructor[R], tag: LifecycleTag[R]): MakeDSLNamedAfterFrom[T]

    Bind to result of acquiring a resource

    Bind to result of acquiring a resource

    The resource will be released when the izumi.distage.model.Locator holding it is released. Typically, after .use is called on the result of izumi.distage.model.Injector#produce

    You can create resources with Lifecycle.make, by inheriting from Lifecycle or by converting an existing cats.effect.Resource

    You can bind a cats.effect.Resource directly:

    import cats.effect._
    
    val myResource: Resource[IO, Unit] = Resource.make(IO(println("Acquiring!")))(IO(println("Releasing!")))
    
    make[Unit].fromResource(myResource)
    Definition Classes
    MakeDSLBase
    See also

    - cats.effect.Resource: https://typelevel.org/cats-effect/datatypes/resource.html

  31. final def fromTrait[I <: T](implicit arg0: TraitConstructor[I]): MakeDSLNamedAfterFrom[T]

    Definition Classes
    MakeDSLBase
    See also

    Auto-Traits feature

  32. final def fromValue[I <: T](instance: I)(implicit arg0: Tag[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  33. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. val key: BasicKey
    Attributes
    protected
    Definition Classes
    MakeNamedDSLMakeDSLBase
  37. final def modify[I <: T](f: (T) => I)(implicit arg0: Tag[I]): MakeNamedDSL[T]
    Definition Classes
    MakeDSLMutBase
  38. final def modifyBy(f: (Functoid[T]) => Functoid[T]): MakeNamedDSL[T]
    Definition Classes
    MakeDSLMutBase
  39. val mutableState: SingletonRef
    Attributes
    protected
    Definition Classes
    MakeNamedDSLMakeDSLMutBase
  40. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  43. final def refEffect[F[_], I <: T, EFF <: F[I]](name: Identifier)(implicit arg0: TagK[F], arg1: Tag[I], arg2: Tag[EFF]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  44. final def refEffect[F[_], I <: T, EFF <: F[I]](implicit arg0: TagK[F], arg1: Tag[I], arg2: Tag[EFF]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  45. final def refEffect[F[_], I <: T](name: Identifier)(implicit arg0: TagK[F], arg1: Tag[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  46. final def refEffect[F[_], I <: T](implicit arg0: TagK[F], arg1: Tag[I]): MakeDSLNamedAfterFrom[T]

    Bind to result of executing an effect bound to a key at F[I]

    Bind to result of executing an effect bound to a key at F[I]

    This will execute the effect again for every refEffect binding

    Example:

    import cats.effect.concurrent.Ref
    import cats.effect.IO
    
    make[IO[Ref[IO, Int]]].named("counterFactory").from(Ref[IO](0))
    
    // execute the effect bound above to key `DIKey.get[IO[Ref[IO, Int]]].named("counterFactory")` to create and bind a new Ref
    make[Ref[IO, Int]].named("globalCounter1")
      .refEffect[IO, Ref[IO, Int]]("counterFactory")
    
    make[Ref[IO, Int]].named("globalCounter2")
      .refEffect[IO, Ref[IO, Int]]("counterFactory")
    
    // globalCounter1 and globalCounter2 are two independent mutable references
    Definition Classes
    MakeDSLBase
  47. final def refResource[R <: Lifecycle[LifecycleF, T]](name: Identifier)(implicit tag: LifecycleTag[R]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  48. final def refResource[R <: Lifecycle[LifecycleF, T]](implicit tag: LifecycleTag[R]): MakeDSLNamedAfterFrom[T]

    Bind to a result of acquiring a resource bound to a key at R

    Bind to a result of acquiring a resource bound to a key at R

    This will acquire a NEW resource again for every refResource binding

    Definition Classes
    MakeDSLBase
  49. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  50. final def tagged(tags: BindingTag*): MakeNamedDSL[T]
    Definition Classes
    MakeDSLMutBaseTagging
  51. def toSame: (SingletonRef) => MakeNamedDSL[T]
    Attributes
    protected
    Definition Classes
    MakeNamedDSLMakeDSLMutBase
  52. def toString(): String
    Definition Classes
    AnyRef → Any
  53. def todo(implicit pos: CodePositionMaterializer): MakeDSLNamedAfterFrom[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.

    Definition Classes
    MakeDSLBase
  54. final def using[I <: T](name: Identifier)(implicit arg0: Tag[I]): MakeDSLNamedAfterFrom[T]
    Definition Classes
    MakeDSLBase
  55. final def using[I <: T](implicit arg0: Tag[I]): MakeDSLNamedAfterFrom[T]

    Bind by reference to another bound key

    Bind by reference to another bound key

    Example:

    trait T
    class T1 extends T
    
    make[T1]
    make[T].using[T1]

    Here, only T1 will be created. A class that depends on T will receive an instance of T1

    Definition Classes
    MakeDSLBase
  56. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  57. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  58. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from MakeDSLBase[T, MakeDSLNamedAfterFrom[T]]

Inherited from MakeDSLMutBase[T, MakeNamedDSL[T]]

Inherited from Tagging[MakeNamedDSL[T]]

Inherited from AddDependencyDSL[T, MakeNamedDSL[T]]

Inherited from AnyRef

Inherited from Any

Ungrouped