ZLayer

zio.ZLayer
See theZLayer companion class

Attributes

Companion
class
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
ZLayer.type

Members list

Type members

Classlikes

object Debug

Attributes

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

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Derive

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Derive.type

Attributes

Companion
trait
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
Supertypes
class Object
trait Matchable
class Any
final implicit class ScopedEnvironmentPartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

Supertypes
class AnyVal
trait Matchable
class Any
final implicit class ScopedPartiallyApplied[R](dummy: Boolean) extends AnyVal

Attributes

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

Attributes

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

Attributes

Supertypes
class AnyVal
trait Matchable
class Any

Inherited types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

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

Constructs a layer from an effectual resource.

Constructs a layer from an effectual resource.

Attributes

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

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

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

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

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

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

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

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.

Attributes

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

Constructs a layer from the specified effect.

Constructs a layer from the specified effect.

Attributes

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

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

Constructs a layer from the specified scoped effect.

Constructs a layer from the specified scoped effect.

Attributes

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

def service[A : Tag](implicit evidence$303: 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

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

Constructs a layer from the specified value.

Constructs a layer from the specified value.

Attributes

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

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

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
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
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

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

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]