Packages

object DIResource

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DIResource
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait Cats[F[_], A] extends DIResourceBase[F, A]
  2. trait DIResourceBase[+F[_], +OuterResource] extends AnyRef
  3. implicit final class DIResourceCatsSyntax[F[_], A] extends AnyVal
  4. implicit final class DIResourceUse[F[_], A] extends AnyVal
  5. trait Mutable[+A] extends DIResourceBase[Identity, A] with AutoCloseable
  6. trait ResourceTag[R] extends AnyRef
  7. trait ResourceTagLowPriority extends AnyRef
  8. trait Simple[A] extends DIResource[Identity, A]

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def fromAutoCloseable[A <: AutoCloseable](acquire: ⇒ A): DIResource[Identity, A]
  9. def fromCats[F[_], A](resource: Resource[F, A])(implicit arg0: Bracket[F, Throwable]): Cats[F, A]

    Convert cats.effect.Resource into a DIResource

  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def make[F[_], A](acquire: ⇒ F[A])(release: (A) ⇒ F[Unit]): DIResource[F, A]
  14. def makeSimple[A](acquire: ⇒ A)(release: (A) ⇒ Unit): DIResource[Identity, A]
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. implicit def providerFromCats[F[_], A](resource: Resource[F, A])(implicit arg0: reflection.universe.RuntimeDIUniverse.TagK[F], arg1: reflection.universe.RuntimeDIUniverse.Tag[A]): ProviderMagnet[Cats[F, A]]

    Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

    Allows you to bind cats.effect.Resource-based constructors in ModuleDef:

    Example:

    import cats.effect._
    
    val catsResource = Resource.liftF(IO(5))
    
    val module = new distage.ModuleDef {
    
      make[Int].fromResource(catsResource)
    
      addImplicit[Bracket[IO, Throwable]]
    }

    NOTE: binding a cats Resource[F, A] will add a dependency on Bracket[F, Throwable] for your corresponding F type

  19. implicit def providerFromCatsProvider[F[_], A](resourceProvider: ProviderMagnet[Resource[F, A]])(implicit arg0: reflection.universe.RuntimeDIUniverse.TagK[F], arg1: reflection.universe.RuntimeDIUniverse.Tag[A]): ProviderMagnet[Cats[F, A]]

    Allows you to bind cats.effect.Resource-based constructor functions in ModuleDef:

    Allows you to bind cats.effect.Resource-based constructor functions in ModuleDef:

    Example:

    import cats.effect._
    import doobie.hikari._
    
    final case class JdbcConfig(driverClassName: String, url: String, user: String, pass: String)
    
    val module = new distage.ModuleDef {
    
      make[ExecutionContext].from(scala.concurrent.ExecutionContext.global)
    
      make[JdbcConfig].from {
        conf: JdbcConfig @ConfPath("jdbc") => conf
      }
    
      make[HikariTransactor[IO]].fromResource {
        (ec: ExecutionContext, jdbc: JdbcConfig) =>
          implicit val C: ContextShift[IO] = IO.contextShift(ec)
    
          HikariTransactor.newHikariTransactor[IO](jdbc.driverClassName, jdbc.url, jdbc.user, jdbc.pass, ec, ec)
      }
    
      addImplicit[Bracket[IO, Throwable]]
    }

    NOTE: binding a cats Resource[F, A] will add a dependency on Bracket[F, Throwable] for your corresponding F type

  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. object ResourceTag extends ResourceTagLowPriority

Deprecated Value Members

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped