object DIResource
- Alphabetic
- By Inheritance
- DIResource
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait AdaptProvider[A] extends AnyRef
Support binding various FP libraries' Resource types in
.fromResource
- trait DIResourceBase[+F[_], +OuterResource] extends AnyRef
Generalized DIResource
- implicit final class DIResourceCatsSyntax[+F[_], +A] extends AnyVal
- implicit final class DIResourceFlatten[F[_], +A] extends AnyVal
- implicit final class DIResourceLocatorRun[F[_]] extends AnyVal
- implicit final class DIResourceSimpleSyntax[+A] extends AnyVal
- implicit final class DIResourceUnsafeGet[F[_], A] extends AnyVal
- implicit final class DIResourceUse[F[_], +A] extends AnyVal
- implicit final class DIResourceUseEffect[F[_], A] extends AnyVal
- implicit final class DIResourceZIOSyntax[-R, +E, +A] extends AnyVal
- class FromAutoCloseable[+F[_], +A <: AutoCloseable] extends Of[[_]F[_], A]
Class-based variant of fromAutoCloseableF:
Class-based variant of fromAutoCloseableF:
class FileOutputRes extends DIResource.FromAutoCloseable( acquire = IO(new FileOutputStream("abc")) )
For binding resources using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait FromCats[F[_], A] extends DIResourceBase[F, A]
- trait FromZIO[R, E, A] extends DIResourceBase[[γ$6$]ZIO[R, E, γ$6$], A]
- class LiftF[+F[_], A] extends NoClose[F, A]
Class-based variant of liftF:
- class Make[+F[_], A] extends DIResource[F, A]
Class-based variant of make:
- class MakePair[F[_], A] extends FromCats[F, A]
Class-based variant of makePair:
- class Make_[+F[_], A] extends Make[F, A]
Class-based variant of make_:
- trait Mutable[+A] extends Self[Identity, A]
- trait MutableNoClose[+A] extends SelfNoClose[Identity, A]
- abstract class NoClose[+F[_], A] extends DIResource.DIResourceBase.NoClose[F, A] with DIResource[F, A]
- class Of[+F[_], +A] extends DIResourceBase[F, A]
Class-based proxy over a DIResource value
Class-based proxy over a DIResource value
class IntRes extends DIResource.Of(DIResource.pure(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class OfCats[F[_], A] extends Of[F, A]
Class-based proxy over a cats.effect.Resource value
Class-based proxy over a cats.effect.Resource value
class IntRes extends DIResource.OfCats(Resource.pure(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- class OfZIO[-R, +E, +A] extends Of[[γ$5$]ZIO[R, E, γ$5$], A]
Class-based proxy over a zio.ZManaged value
Class-based proxy over a zio.ZManaged value
class IntRes extends DIResource.OfZIO(Managed.succeed(1000))
For binding resource values using class syntax in ModuleDef:
val module = new ModuleDef { make[Int].fromResource[IntRes] }
- trait ResourceTag[R] extends AnyRef
- sealed trait ResourceTagLowPriority extends AnyRef
- trait Self[+F[_], +A] extends DIResourceBase[F, A]
- abstract class SelfNoClose[+F[_], +A] extends DIResource.DIResourceBase.NoClose[F, A]
- trait Simple[A] extends DIResource[Identity, A]
- trait TrifunctorHasResourceTag[R0, T] extends AnyRef
- sealed trait TrifunctorHasResourceTagLowPriority extends TrifunctorHasResourceTagLowPriority1
- sealed trait TrifunctorHasResourceTagLowPriority1 extends AnyRef
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromAutoCloseable[A <: AutoCloseable](acquire: => A): DIResource[Identity, A]
- def fromAutoCloseableF[F[_], A <: AutoCloseable](acquire: => F[A])(implicit F: DIEffect[F]): DIResource[F, A]
- def fromCats[F[_], A](resource: Resource[F, A])(implicit arg0: Bracket[F, Throwable]): FromCats[F, A]
Convert cats.effect.Resource to DIResource
- def fromExecutorService[A <: ExecutorService](acquire: => A): DIResource[Identity, A]
- def fromZIO[R, E, A](managed: ZManaged[R, E, A]): FromZIO[R, E, A]
Convert zio.ZManaged to DIResource
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def liftF[F[_], A](acquire: => F[A])(implicit F: DIApplicative[F]): DIResource[F, A]
- def make[F[_], A](acquire: => F[A])(release: (A) => F[Unit]): DIResource[F, A]
- def makePair[F[_], A](allocate: F[(A, F[Unit])]): FromCats[F, A]
- def makeSimple[A](acquire: => A)(release: (A) => Unit): DIResource[Identity, A]
- def make_[F[_], A](acquire: => F[A])(release: => F[Unit]): DIResource[F, A]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit final def providerFromCats[F[_], A](resource: => Resource[F, A])(implicit arg0: TagK[F], tag: Tag[FromCats[F, A]]): ProviderMagnet[FromCats[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 correspondingF
type - implicit final def providerFromZIO[R, E, A](managed: => ZManaged[R, E, A])(implicit tag: Tag[FromZIO[R, E, A]]): ProviderMagnet[FromZIO[R, E, A]]
Allows you to bind zio.ZManaged-based constructors in
ModuleDef
: - implicit final def providerFromZIONothing[R, A](managed: => ZManaged[R, Nothing, A])(implicit tag: Tag[FromZIO[R, Nothing, A]]): ProviderMagnet[FromZIO[R, Nothing, A]]
Allows you to bind zio.ZManaged-based constructors in
ModuleDef
: - implicit final def providerFromZLayerHas1[R, E, A](layer: => ZLayer[R, E, Has[A]])(implicit arg0: Tag[A], tag: Tag[FromZIO[R, E, A]]): ProviderMagnet[FromZIO[R, E, A]]
Allows you to bind zio.ZLayer-based constructors in
ModuleDef
: - implicit final def providerFromZLayerNothingHas1[R, A](layer: => ZLayer[R, Nothing, Has[A]])(implicit arg0: Tag[A], tag: Tag[FromZIO[R, Nothing, A]]): ProviderMagnet[FromZIO[R, Nothing, A]]
Allows you to bind zio.ZLayer-based constructors in
ModuleDef
: - def pure[F[_], A](a: A)(implicit F: DIApplicative[F]): DIResource[F, A]
- def suspend[F[_], A](acquire: => F[DIResourceBase[F, A]])(implicit arg0: DIEffect[F]): DIResourceBase[F, A]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unit[F[_]](implicit F: DIApplicative[F]): DIResource[F, Unit]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object AdaptProvider
- object DIResourceBase
- object ResourceTag extends ResourceTagLowPriority
- object ResourceTagMacro
- object TrifunctorHasResourceTag extends TrifunctorHasResourceTagLowPriority