object ZLayer extends ZLayerCompanionVersionSpecific
- Alphabetic
- By Inheritance
- ZLayer
- ZLayerCompanionVersionSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait Debug extends AnyRef
- trait FunctionConstructor[In] extends AnyRef
A
FunctionConstructor[Input]
knows how to construct aZLayer
value from a function of typeInput
.A
FunctionConstructor[Input]
knows how to construct aZLayer
value from a function of typeInput
. This allows the type of theZLayer
value constructed to depend onInput
. - implicit final class ScopedEnvironmentPartiallyApplied[R] extends AnyVal
- implicit final class ScopedPartiallyApplied[R] extends AnyVal
- implicit final class ZLayerInvariantOps[RIn, E, ROut] extends AnyVal
- implicit final class ZLayerProvideSomeOps[RIn, E, ROut] extends AnyVal
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
- def apply[RIn, E, ROut](zio: => ZIO[RIn, E, ROut])(implicit arg0: Tag[ROut], trace: Trace): ZLayer[RIn, E, ROut]
Constructs a layer from an effectual resource.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collectAll[R, E, A, Collection[+Element] <: Iterable[Element]](in: => Collection[ZLayer[R, E, A]])(implicit arg0: Tag[A], tag: Tag[Collection[A]], bf: zio.BuildFrom[Collection[ZLayer[R, E, A]], A, Collection[A]], trace: Trace): ZLayer[R, E, Collection[A]]
Gathers up the ZLayer inside of the given collection, and combines them into a single ZLayer containing an equivalent collection of results.
- def debug(value: => Any)(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
Prints the specified message to the console for debugging purposes.
- macro def derive[A]: ZLayer[Nothing, Any, A]
Automatically derives a simple layer for the provided type.
Automatically derives a simple layer for the provided type.
class Car(wheels: Wheels, engine: Engine) { /* ... */ } val carLayer: URLayer[Wheels & Engine, Car] = ZLayer.derive[Car]
- Definition Classes
- ZLayerCompanionVersionSpecific
- final def die(t: => Throwable)(implicit trace: Trace): ZLayer[Any, Nothing, Nothing]
Constructs a layer that dies with the specified throwable.
- val empty: ZLayer[Any, Nothing, Any]
A layer that does not produce any services.
- def environment[A](implicit trace: Trace): ZLayer[A, Nothing, A]
Constructs a layer that passes along the specified environment as an output.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail[E](e: => E)(implicit trace: Trace): Layer[E, Nothing]
Constructs a layer that fails with the specified error.
- def failCause[E](cause: => Cause[E])(implicit trace: Trace): Layer[E, Nothing]
Constructs a layer that fails with the specified cause.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def foreach[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: => Collection[A])(f: (A) => ZLayer[R, E, B])(implicit arg0: Tag[B], tag: Tag[Collection[B]], bf: zio.BuildFrom[Collection[A], B, Collection[B]], trace: Trace): ZLayer[R, E, Collection[B]]
Applies the function
f
to each element of theCollection[A]
and returns the results in a newCollection[B]
. - def fromFunction[In](in: In)(implicit constructor: FunctionConstructor[In], trace: Trace): Out
Constructs a layer from the specified function.
- def fromZIO[R, E, A](zio: => ZIO[R, E, A])(implicit arg0: Tag[A], trace: Trace): ZLayer[R, E, A]
Constructs a layer from the specified effect.
- def fromZIOEnvironment[R, E, A](zio: => ZIO[R, E, ZEnvironment[A]])(implicit trace: Trace): ZLayer[R, E, A]
Constructs a layer from the specified effect, which must return one or more services.
- 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 make[R]: MakePartiallyApplied[R]
Automatically assembles a layer for the provided type.
Automatically assembles a layer for the provided type.
ZLayer.make[Car](carLayer, wheelsLayer, engineLayer)
- Definition Classes
- ZLayerCompanionVersionSpecific
- def makeSome[R0, R]: MakeSomePartiallyApplied[R0, R]
Automatically constructs a layer for the provided type
R
, leaving a remainderR0
.Automatically constructs a layer for the provided type
R
, leaving a remainderR0
.val carLayer: ZLayer[Engine with Wheels, Nothing, Car] = ??? val wheelsLayer: ZLayer[Any, Nothing, Wheels] = ??? val layer = ZLayer.makeSome[Engine, Car](carLayer, wheelsLayer)
- Definition Classes
- ZLayerCompanionVersionSpecific
- 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()
- def refailCause[E](cause: Cause[E])(implicit trace: Trace): Layer[E, Nothing]
Constructs a layer that refails with the specified cause.
- def scoped[R]: ScopedPartiallyApplied[R]
Constructs a layer from the specified scoped effect.
- def scopedEnvironment[R]: ScopedEnvironmentPartiallyApplied[R]
Constructs a layer from the specified scoped effect, which must return one or more services.
- def service[A](implicit arg0: Tag[A], trace: Trace): ZLayer[A, Nothing, A]
Constructs a layer that accesses and returns the specified service from the environment.
- def succeed[A](a: => A)(implicit arg0: Tag[A], trace: Trace): ULayer[A]
Constructs a layer from the specified value.
- def succeedEnvironment[A](a: => ZEnvironment[A])(implicit trace: Trace): ULayer[A]
Constructs a layer from the specified value, which must return one or more services.
- def suspend[RIn, E, ROut](layer: => ZLayer[RIn, E, ROut]): ZLayer[RIn, E, ROut]
Lazily constructs a layer.
Lazily constructs a layer. This is useful to avoid infinite recursion when creating layers that refer to themselves.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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 Debug
- object Derive
- object FunctionConstructor