ZLayer

Companion:
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any
ZLayer.type

Type members

Classlikes

object Debug
Companion:
class
sealed trait Debug
Companion:
object
Companion:
class

A FunctionConstructor[Input] knows how to construct a ZLayer value from a function of type Input. This allows the type of the ZLayer value constructed to depend on Input.

A FunctionConstructor[Input] knows how to construct a ZLayer value from a function of type Input. This allows the type of the ZLayer value constructed to depend on Input.

Companion:
object
final implicit class ScopedEnvironmentPartiallyApplied[R](dummy: Boolean) extends AnyVal
final implicit class ScopedPartiallyApplied[R](dummy: Boolean) extends AnyVal
final implicit class ZLayerInvariantOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]) extends AnyVal
final implicit class ZLayerProvideSomeOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]) extends AnyVal

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def apply[RIn, E, ROut : Tag](zio: => ZIO[RIn, E, ROut])(implicit evidence$287: Tag[ROut], trace: Trace): ZLayer[RIn, E, ROut]

Constructs a layer from an effectual resource.

Constructs a layer from an effectual resource.

def collectAll[R, E, A : Tag, Collection <: (Iterable)](in: => Collection[ZLayer[R, E, A]])(implicit evidence$288: Tag[A], tag: Tag[Collection[A]], bf: 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.

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.

Prints the specified message to the console for debugging purposes.

final def die(t: => Throwable)(implicit trace: Trace): ZLayer[Any, Nothing, Nothing]

Constructs a layer that dies with the specified throwable.

Constructs a layer that dies with the specified throwable.

def environment[A](implicit trace: Trace): ZLayer[A, Nothing, A]

Constructs a layer that passes along the specified environment as an output.

Constructs a layer that passes along the specified environment as an output.

def fail[E](e: => E)(implicit trace: Trace): Layer[E, Nothing]

Constructs a layer that fails with the specified error.

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.

Constructs a layer that fails with the specified cause.

def foreach[R, E, A, B : Tag, Collection <: (Iterable)](in: => Collection[A])(f: A => ZLayer[R, E, B])(implicit evidence$289: Tag[B], tag: Tag[Collection[B]], bf: BuildFrom[Collection[A], B, Collection[B]], trace: Trace): ZLayer[R, E, Collection[B]]

Applies the function f to each element of the Collection[A] and returns the results in a new Collection[B].

Applies the function f to each element of the Collection[A] and returns the results in a new Collection[B].

def fromFunction[In](in: In)(implicit constructor: FunctionConstructor[In], trace: Trace): Out

Constructs a layer from the specified function.

Constructs a layer from the specified function.

def fromZIO[R, E, A : Tag](zio: => ZIO[R, E, A])(implicit evidence$290: Tag[A], trace: Trace): ZLayer[R, E, A]

Constructs a layer from the specified effect.

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.

Constructs a layer from the specified effect, which must return one or more services.

def refailCause[E](cause: Cause[E])(implicit trace: Trace): Layer[E, Nothing]

Constructs a layer that refails with the specified cause.

Constructs a layer that refails with the specified cause.

Constructs a layer from the specified scoped effect.

Constructs a layer from the specified scoped effect.

Constructs a layer from the specified scoped effect, which must return one or more services.

Constructs a layer from the specified scoped effect, which must return one or more services.

def service[A : Tag](implicit evidence$291: Tag[A], trace: Trace): ZLayer[A, Nothing, A]

Constructs a layer that accesses and returns the specified service from the environment.

Constructs a layer that accesses and returns the specified service from the environment.

def succeed[A : Tag](a: => A)(implicit evidence$292: Tag[A], trace: Trace): ULayer[A]

Constructs a layer from the specified value.

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.

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. This is useful to avoid infinite recursion when creating layers that refer to themselves.

Lazily constructs a layer. This is useful to avoid infinite recursion when creating layers that refer to themselves.

Inherited methods

inline def make[R]: WirePartiallyApplied[R]

Automatically assembles a layer for the provided type.

Automatically assembles a layer for the provided type.

val layer = ZLayer.make[Car](carLayer, wheelsLayer, engineLayer)
Inherited from:
ZLayerCompanionVersionSpecific

Automatically assembles a layer for the provided type R, leaving a remainder R0.

Automatically assembles a layer for the provided type R, leaving a remainder R0.

val carLayer: ZLayer[Engine with Wheels, Nothing, Car] = ???
val wheelsLayer: ZLayer[Any, Nothing, Wheels] = ???

val layer = ZLayer.makeSome[Engine, Car](carLayer, wheelsLayer)
Inherited from:
ZLayerCompanionVersionSpecific

Concrete fields

val empty: ZLayer[Any, Nothing, Any]

A layer that does not produce any services.

A layer that does not produce any services.

Implicits

Implicits

final implicit def ScopedPartiallyApplied[R](dummy: Boolean): ScopedPartiallyApplied[R]
final implicit def ZLayerInvariantOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]): ZLayerInvariantOps[RIn, E, ROut]
final implicit def ZLayerProvideSomeOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]): ZLayerProvideSomeOps[RIn, E, ROut]