ZLayer

zio.ZLayer
See theZLayer companion class
object ZLayer

Attributes

Companion
class
Source
ZLayer.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ZLayer.type

Members list

Type members

Classlikes

object Debug

Attributes

Companion
trait
Source
ZLayer.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Debug.type
sealed trait Debug

Attributes

Companion
object
Source
ZLayer.scala
Supertypes
class Object
trait Matchable
class Any
object Derive

Attributes

Source
ZLayer.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Derive.type

Attributes

Companion
trait
Source
ZLayer.scala
Supertypes
class Object
trait Matchable
class Any
Self type

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.

Attributes

Companion
object
Source
ZLayer.scala
Supertypes
class Object
trait Matchable
class Any
final implicit class ScopedEnvironmentPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZLayer.scala
Supertypes
class AnyVal
trait Matchable
class Any
final implicit class ScopedPartiallyApplied[R](dummy: Boolean = ...) extends AnyVal

Attributes

Source
ZLayer.scala
Supertypes
class AnyVal
trait Matchable
class Any
final implicit class ZLayerInvariantOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]) extends AnyVal

Attributes

Source
ZLayer.scala
Supertypes
class AnyVal
trait Matchable
class Any
final implicit class ZLayerProvideSomeOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]) extends AnyVal

Attributes

Source
ZLayer.scala
Supertypes
class AnyVal
trait Matchable
class Any

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

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

Constructs a layer from an effectual resource.

Constructs a layer from an effectual resource.

Attributes

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

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
def foreach[R, E, A, B : Tag, Collection <: (Iterable)](in: => Collection[A])(f: A => ZLayer[R, E, B])(implicit evidence$1: 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].

Attributes

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

Constructs a layer from the specified function.

Constructs a layer from the specified function.

Attributes

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

Constructs a layer from the specified effect.

Constructs a layer from the specified effect.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala

Constructs a layer from the specified scoped effect.

Constructs a layer from the specified scoped effect.

Attributes

Source
ZLayer.scala

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.

Attributes

Source
ZLayer.scala
def service[A : Tag](implicit evidence$1: 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.

Attributes

Source
ZLayer.scala
def succeed[A : Tag](a: => A)(implicit evidence$1: Tag[A], trace: Trace): ULayer[A]

Constructs a layer from the specified value.

Constructs a layer from the specified value.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala
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.

Attributes

Source
ZLayer.scala

Inherited methods

transparent inline 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]

Attributes

Inherited from:
ZLayerCompanionVersionSpecific (hidden)
Source
ZLayerCompanionVersionSpecific.scala
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

Inherited from:
ZLayerCompanionVersionSpecific (hidden)
Source
ZLayerCompanionVersionSpecific.scala
def makeSome[R0, R]: WireSomePartiallyApplied[R0, R]

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

Inherited from:
ZLayerCompanionVersionSpecific (hidden)
Source
ZLayerCompanionVersionSpecific.scala

Concrete fields

val empty: ZLayer[Any, Nothing, Any]

A layer that does not produce any services.

A layer that does not produce any services.

Attributes

Source
ZLayer.scala
val unit: ULayer[Unit]

A layer that succeeds with a unit value.

A layer that succeeds with a unit value.

Attributes

Source
ZLayer.scala

Implicits

Implicits

Attributes

Source
ZLayer.scala
final implicit def ScopedPartiallyApplied[R](dummy: Boolean = ...): ScopedPartiallyApplied[R]

Attributes

Source
ZLayer.scala
final implicit def ZLayerInvariantOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]): ZLayerInvariantOps[RIn, E, ROut]

Attributes

Source
ZLayer.scala
final implicit def ZLayerProvideSomeOps[RIn, E, ROut](self: ZLayer[RIn, E, ROut]): ZLayerProvideSomeOps[RIn, E, ROut]

Attributes

Source
ZLayer.scala