zio.ZLayer.Derive.Default
See theDefault companion trait
object Default
Attributes
Members list
Type members
Classlikes
final implicit class ZLayerDefaultInvariantOps[R, E, A](self: WithContext[R, E, A]) extends AnyVal
Attributes
- Supertypes
-
class AnyValtrait Matchableclass Any
Types
Value members
Concrete methods
Summons the implicit default for the specified type.
Summons the implicit default for the specified type.
Attributes
Uses the provided layer as the default layer.
Uses the provided layer as the default layer.
Attributes
Constructs a default layer using the provided ZIO value.
Constructs a default layer using the provided ZIO value.
Attributes
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] }
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.
Constructs a default layer using the provided value.
Attributes
Implicits
Implicits
final implicit def ZLayerDefaultInvariantOps[R, E, A](self: WithContext[R, E, A]): ZLayerDefaultInvariantOps[R, E, A]
implicit def deriveDefaultConfig[A : Tag](implicit evidence$1: Tag[A], ev: Config[A], trace: Trace): WithContext[Any, Error, A]
implicit def deriveDefaultHub[A : Tag](implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, Hub[A]]
implicit def deriveDefaultPromise[E : Tag, A : Tag](implicit evidence$1: Tag[E], evidence$2: Tag[A], trace: Trace): WithContext[Any, Nothing, Promise[E, A]]
implicit def deriveDefaultQueue[A : Tag](implicit evidence$1: Tag[A], trace: Trace): WithContext[Any, Nothing, Queue[A]]
implicit def deriveDefaultRef[A : Tag](implicit evidence$1: Tag[A], ev: Default[A], trace: Trace): WithContext[ev.R, ev.E, Ref[A]]
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)
In this article