Class/Object

zio

ZLayer

Related Docs: object ZLayer | package zio

Permalink

final class ZLayer[-RIn, +E, +ROut <: Has[_]] extends AnyRef

A ZLayer[A, E, B] describes a layer of an application: every layer in an application requires some services (the input) and produces some services (the output).

Layers can be thought of as recipes for producing bundles of services, given their dependencies (other services).

Construction of layers can be effectful and utilize resources that must be acquired and safetly released when the services are done being utilized.

By default layers are shared, meaning that if the same layer is used twice the layer will only be allocated a single time.

Because of their excellent composition properties, layers are the idiomatic way in ZIO to create services that depend on other services.

Self Type
ZLayer[RIn, E, ROut]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZLayer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +!+[E1 >: E, RIn2, ROut2 <: Has[_]](that: ZLayer[RIn2, E1, ROut2]): ZLayer[RIn with RIn2, E1, ROut with ROut2]

    Permalink
  4. def ++[E1 >: E, RIn2, ROut1 >: ROut <: Has[_], ROut2 <: Has[_]](that: ZLayer[RIn2, E1, ROut2])(implicit tagged: Tagged[ROut2]): ZLayer[RIn with RIn2, E1, ROut1 with ROut2]

    Permalink

    Combines this layer with the specified layer, producing a new layer that has the inputs of both layers, and the outputs of both layers.

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def >>>[E1 >: E, ROut2 <: Has[_]](that: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2]

    Permalink

    Feeds the output services of this layer into the input of the specified layer, resulting in a new layer with the inputs of this layer, and the outputs of the specified layer.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def build: ZManaged[RIn, E, ROut]

    Permalink

    Builds a layer into a managed value.

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fold[E1, ROut2 <: Has[_]](failure: ZLayer[E, E1, ROut2], success: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2]

    Permalink

    Feeds the error or output services of this layer into the input of either the specified failure or success layers, resulting in a new layer with the inputs of this layer, and the error or outputs of the specified layer.

  14. def fresh: ZLayer[RIn, E, ROut]

    Permalink

    Creates a fresh version of this layer that will not be shared.

  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def map[ROut1 >: ROut <: Has[_]](f: (ROut) ⇒ ROut1): ZLayer[RIn, E, ROut1]

    Permalink

    Returns a new layer whose output is mapped by the specified function.

  19. def mapError[E1](f: (E) ⇒ E1): ZLayer[RIn, E1, ROut]

    Permalink

    Returns a layer with its error channel mapped using the specified function.

  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toRuntime(p: Platform)(implicit ev: <:<[Any, RIn]): Managed[E, Runtime[ROut]]

    Permalink

    Converts a layer that requires no services into a managed runtime, which can be used to execute effects.

  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. def update[A](f: (A) ⇒ A)(implicit arg0: Tagged[A], ev: <:<[ROut, Has[A]]): ZLayer[RIn, E, ROut]

    Permalink

    Updates one of the services output by this layer.

  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def zipWithPar[E1 >: E, RIn2, ROut1 >: ROut <: Has[_], ROut2 <: Has[_], ROut3 <: Has[_]](that: ZLayer[RIn2, E1, ROut2])(f: (ROut, ROut2) ⇒ ROut3): ZLayer[RIn with RIn2, E1, ROut3]

    Permalink

    Combines this layer with the specified layer, producing a new layer that has the inputs of both layers, and the outputs of both layers combined using the specified function.

Inherited from AnyRef

Inherited from Any

Ungrouped