AddNodeResult

data class AddNodeResult<V>(val tree: MovableTree<V>, val nodeId: String, val patch: Patch<MovableTree<V>>)

The result of MovableTree.addNode: the updated tree, the newly minted node id, and the Patch that encodes the insertion delta for delta-propagation to peers.

Supports three-element destructuring:

val (tree, nodeId, patch) = base.addNode(alice, ts = 1L, parent = ROOT_ID, value = "A")
// ship `patch` to peers; they absorb with `peer.piece(patch)`

Two-element destructuring also compiles when the patch is not needed locally:

val (tree, nodeId) = base.addNode(...)

Constructors

Link copied to clipboard
constructor(tree: MovableTree<V>, nodeId: String, patch: Patch<MovableTree<V>>)

Properties

Link copied to clipboard

The id minted for the new node ("<value>:<replica>:<ts>").

Link copied to clipboard

Delta patch carrying just the insertion op — absorb on peers with MovableTree.piece.

Link copied to clipboard

The tree after the new node has been applied.