RefCompanion

class Object
trait Matchable
class Any
object Ref

Value members

Abstract methods

protected def factory: RefFactory

Concrete methods

def apply[A](initialValue: A): Ref[A]

Returns a Ref instance that manages a newly allocated memory location, initializing it to hold initialValue. The returned Ref is not part of any transaction's read or write set.

Returns a Ref instance that manages a newly allocated memory location, initializing it to hold initialValue. The returned Ref is not part of any transaction's read or write set.

Example:

  val x = Ref("initial") // creates a Ref[String]
  val list1 = Ref(Nil : List[String]) // creates a Ref[List[String]]
  val list2 = Ref[List[String]](Nil)  // creates a Ref[List[String]]
def apply(initialValue: Boolean): Ref[Boolean]
def apply(initialValue: Byte): Ref[Byte]
def apply(initialValue: Short): Ref[Short]
def apply(initialValue: Char): Ref[Char]
def apply(initialValue: Int): Ref[Int]
def apply(initialValue: Long): Ref[Long]
def apply(initialValue: Float): Ref[Float]
def apply(initialValue: Double): Ref[Double]
def apply(initialValue: Unit): Ref[Unit]
inline def make[A](): Ref[A]

Returns a Ref instance that manages a newly allocated memory location holding values of type A. If you have an initial value v0 available, Ref(v0) should be preferred.

Returns a Ref instance that manages a newly allocated memory location holding values of type A. If you have an initial value v0 available, Ref(v0) should be preferred.