Trait/Object

zio

ZRefM

Related Docs: object ZRefM | package zio

Permalink

sealed trait ZRefM[-RA, -RB, +EA, +EB, -A, +B] extends AnyRef

A ZRefM[RA, RB, EA, EB, A, B] is a polymorphic, purely functional description of a mutable reference. The fundamental operations of a ZRefM are set and get. set takes a value of type A and sets the reference to a new value, requiring an environment of type RA and potentially failing with an error of type EA. get gets the current value of the reference and returns a value of type B, requiring an environment of type RB and potentially failing with an error of type EB.

When the error and value types of the ZRefM are unified, that is, it is a ZRefM[E, E, A, A], the ZRefM also supports atomic modify and update operations.

Unlike ZRef, ZRefM allows performing effects within update operations, at some cost to performance. Writes will semantically block other writers, while multiple readers can read simultaneously.

Self Type
ZRefM[RA, RB, EA, EB, A, B]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZRefM
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def foldAllM[RC <: RA with RB, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ec: (EB) ⇒ EC, ca: (C) ⇒ (B) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Permalink

    Folds over the error and value types of the ZRefM, allowing access to the state in transforming the set value.

    Folds over the error and value types of the ZRefM, allowing access to the state in transforming the set value. This is a more powerful version of foldM but requires unifying the environment and error types.

  2. abstract def foldM[RC <: RA, RD <: RB, EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ca: (C) ⇒ ZIO[RC, EC, A], bd: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Permalink

    Folds over the error and value types of the ZRefM.

    Folds over the error and value types of the ZRefM. This is a highly polymorphic method that is capable of arbitrarily transforming the error and value types of the ZRefM. For most use cases one of the more specific combinators implemented in terms of foldM will be more ergonomic but this method is extremely useful for implementing new combinators.

  3. abstract def get: ZIO[RB, EB, B]

    Permalink

    Reads the value from the ZRefM.

  4. abstract def set(a: A): ZIO[RA, EA, Unit]

    Permalink

    Writes a new value to the ZRefM, with a guarantee of immediate consistency (at some cost to performance).

  5. abstract def setAsync(a: A): ZIO[RA, EA, Unit]

    Permalink

    Writes a new value to the ZRefM without providing a guarantee of immediate consistency.

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def collect[C](pf: PartialFunction[B, C]): ZRefM[RA, RB, EA, Option[EB], A, C]

    Permalink

    Maps and filters the get value of the ZRefM with the specified partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

  7. final def collectM[RC <: RB, EC >: EB, C](pf: PartialFunction[B, ZIO[RC, EC, C]]): ZRefM[RA, RC, EA, Option[EC], A, C]

    Permalink

    Maps and filters the get value of the ZRefM with the specified effectual partial function, returning a ZRefM with a get value that succeeds with the result of the partial function if it is defined or else fails with None.

  8. final def contramap[C](f: (C) ⇒ A): ZRefM[RA, RB, EA, EB, C, B]

    Permalink

    Transforms the set value of the ZRefM with the specified function.

  9. final def contramapM[RC <: RA, EC >: EA, C](f: (C) ⇒ ZIO[RC, EC, A]): ZRefM[RC, RB, EC, EB, C, B]

    Permalink

    Transforms the set value of the ZRefM with the specified effectual function.

  10. final def dimap[C, D](f: (C) ⇒ A, g: (B) ⇒ D): ZRefM[RA, RB, EA, EB, C, D]

    Permalink

    Transforms both the set and get values of the ZRefM with the specified functions.

  11. final def dimapError[EC, ED](f: (EA) ⇒ EC, g: (EB) ⇒ ED): ZRefM[RA, RB, EC, ED, A, B]

    Permalink

    Transforms both the set and get errors of the ZRefM with the specified functions.

  12. final def dimapM[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZIO[RC, EC, A], g: (B) ⇒ ZIO[RD, ED, D]): ZRefM[RC, RD, EC, ED, C, D]

    Permalink

    Transforms both the set and get values of the ZRefM with the specified effectual functions.

  13. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def filterInput[A1 <: A](f: (A1) ⇒ Boolean): ZRefM[RA, RB, Option[EA], EB, A1, B]

    Permalink

    Filters the set value of the ZRefM with the specified predicate, returning a ZRefM with a set value that succeeds if the predicate is satisfied or else fails with None.

  16. final def filterInputM[RC <: RA, EC >: EA, A1 <: A](f: (A1) ⇒ ZIO[RC, EC, Boolean]): ZRefM[RC, RB, Option[EC], EB, A1, B]

    Permalink

    Filters the set value of the ZRefM with the specified effectual predicate, returning a ZRefM with a set value that succeeds if the predicate is satisfied or else fails with None.

  17. final def filterOutput(f: (B) ⇒ Boolean): ZRefM[RA, RB, EA, Option[EB], A, B]

    Permalink

    Filters the get value of the ZRefM with the specified predicate, returning a ZRefM with a get value that succeeds if the predicate is satisfied or else fails with None.

  18. final def filterOutputM[RC <: RB, EC >: EB](f: (B) ⇒ ZIO[RC, EC, Boolean]): ZRefM[RA, RC, EA, Option[EC], A, B]

    Permalink

    Filters the get value of the ZRefM with the specified effectual predicate, returning a ZRefM with a get value that succeeds if the predicate is satisfied or else fails with None.

  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def fold[EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ca: (C) ⇒ Either[EC, A], bd: (B) ⇒ Either[ED, D]): ZRefM[RA, RB, EC, ED, C, D]

    Permalink

    Folds over the error and value types of the ZRefM.

  21. def foldAll[EC, ED, C, D](ea: (EA) ⇒ EC, eb: (EB) ⇒ ED, ec: (EB) ⇒ EC, ca: (C) ⇒ (B) ⇒ Either[EC, A], bd: (B) ⇒ Either[ED, D]): ZRefM[RA with RB, RB, EC, ED, C, D]

    Permalink

    Folds over the error and value types of the ZRefM, allowing access to the state in transforming the set value but requiring unifying the error type.

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

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

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

    Permalink
    Definition Classes
    Any
  25. final def map[C](f: (B) ⇒ C): ZRefM[RA, RB, EA, EB, A, C]

    Permalink

    Transforms the get value of the ZRefM with the specified function.

  26. final def mapM[RC <: RB, EC >: EB, C](f: (B) ⇒ ZIO[RC, EC, C]): ZRefM[RA, RC, EA, EC, A, C]

    Permalink

    Transforms the get value of the ZRefM with the specified effectual function.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  30. final def readOnly: ZRefM[RA, RB, EA, EB, Nothing, B]

    Permalink

    Returns a read only view of the ZRefM.

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. final def tapInput[RC <: RA, EC >: EA, A1 <: A](f: (A1) ⇒ ZIO[RC, EC, Any]): ZRefM[RC, RB, EC, EB, A1, B]

    Permalink

    Performs the specified effect every time a value is written to this ZRefM.

  33. final def tapOutput[RC <: RB, EC >: EB](f: (B) ⇒ ZIO[RC, EC, Any]): ZRefM[RA, RC, EA, EC, A, B]

    Permalink

    Performs the specified effect very time a value is read from this ZRefM.

  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def writeOnly: ZRefM[RA, RB, EA, Unit, A, Nothing]

    Permalink

    Returns a write only view of the ZRefM.

Inherited from AnyRef

Inherited from Any

Ungrouped