zio.ZLayer.Derive.Default
See theDefault companion trait
object Default
Attributes
- Companion
- trait
- Source
- ZLayer.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Default.type
Members list
Type members
Classlikes
final implicit class ZLayerDefaultInvariantOps[R, E, A](self: WithContext[R, E, A]) extends AnyVal
Attributes
- Source
- ZLayer.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
Types
Attributes
- Source
- ZLayer.scala
Value members
Concrete methods
Summons the implicit default for the specified type.
Uses the provided layer as the default layer.
Constructs a default layer using the provided ZIO value.
Makes a default value that requires the specified service from the environment.
Makes a default value that requires the specified service from the environment.
Used to discard a predefined Default instance for ZLayer.derive.
Attributes
- Example
-
class Wheels(number: Int) object Wheels { implicit val defaultWheels: ZLayer.Default.WithContext[Any, Nothing, Wheels] = ZLayer.Default.succeed(new Wheels(4)) } class Car(wheels: Wheels) val carLayer1: ULayer[Car] = ZLayer.derive // wheels.number == 4 val carLayer2: URLayer[Wheels, Car] = locally { // The default instance is discarded implicit val newWheels: ZLayer.Default.WithContext[Wheels, Nothing, Wheels] = ZLayer.Default.service[Wheels] ZLayer.derive[Car] } - Source
- ZLayer.scala
def succeed[A : Tag](a: => A)(implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, A]
Constructs a default layer using the provided value.
Implicits
Implicits
final implicit def ZLayerDefaultInvariantOps[R, E, A](self: WithContext[R, E, A]): ZLayerDefaultInvariantOps[R, E, A]
Attributes
- Source
- ZLayer.scala
implicit def deriveDefaultConfig[A : Tag](implicit evidence$1: Tag[A], ev: Config[A], trace: Trace): WithContext[Any, Error, A]
Attributes
- Source
- ZLayer.scala
implicit def deriveDefaultHub[A : Tag](implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, Hub[A]]
Attributes
- Source
- ZLayer.scala
implicit def deriveDefaultPromise[E : Tag, A : Tag](implicit evidence$1: Tag[E], evidence$2: Tag[A], trace: Trace): WithContext[Any, Nothing, Promise[E, A]]
Attributes
- Source
- ZLayer.scala
implicit def deriveDefaultQueue[A : Tag](implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, Queue[A]]
Attributes
- Source
- ZLayer.scala
implicit def deriveDefaultRef[A : Tag](implicit evidence$1: Tag[A], ev: Default[A], trace: Trace): WithContext[ev.R, ev.E, Ref[A]]
Attributes
- Source
- ZLayer.scala
Inherited implicits
implicit def defaultPromiseNothing[A : Tag](implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, Promise[Nothing, A]]
Attributes
- Inherited from:
- DefaultInstances0 (hidden)
- Source
- ZLayer.scala
In this article