class Pf::Map::Commit(K, V)

Overview

Commits allow you to compose multiple edits into one, big edit of the map. Thus you avoid creating many useless intermediate copies of the map.

Defined in:

permafrost/map.cr

Instance Method Summary

Instance Method Detail

def [](key : K) : V #

Runs Map#[] on the map built so far.


[View source]
def []?(key : K) : V | Nil #

Runs Map#[]? on the map built so far.


[View source]
def assoc(key : K, value : V) : self #

Commits the association between key and value to the map.

Raises ResolvedError if this commit is used outside of the transaction (see Map#transaction) that produced it.

Raises ReadonlyError if called by a fiber other than the fiber that initiated the transaction.


[View source]
def dissoc(key : K) : self #

Commits the removal of an association between key and value from the map.

Raises ResolvedError if this commit is used outside of the transaction (see Map#transaction) that produced it.

Raises ReadonlyError if called by a fiber other than the fiber that initiated the transaction.


[View source]
def includes?(object) : Bool #

Runs Map#includes? on the map built so far.


[View source]
def size : Int32 #

Runs Map#size on the map built so far.


[View source]