ZLayerCompanionVersionSpecific

zio.ZLayerCompanionVersionSpecific

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ZLayer.type

Members list

Concise view

Value members

Concrete methods

inline def derive[A](using m: ProductOf[A]): URLayer[Env[<none>], A]

Derives a simple layer for a case class given as a type parameter.

Derives a simple layer for a case class given as a type parameter.

case class Car(engine: Engine, wheels: Wheels)
val derivedLayer: ZLayer[Engine & Wheels, Nothing, Car] = ZLayer.deriveLayer[Car]
// equivalent to:
val manualLayer: ZLayer[Engine & Wheels, Nothing, Car] =
 ZLayer.fromFunction(Car(_, _))

Attributes

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)

Attributes

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)

Attributes