DiffTree

merkle.DiffTree
See theDiffTree companion trait
object DiffTree

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
DiffTree.type

Members list

Type members

Classlikes

case class DLeaf(label: String, action: DiffOutcome) extends DiffTree

Attributes

Supertypes
trait DiffTree
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DNode(label: String, action: DiffOutcome, subtrees: List[DiffTree]) extends DiffTree

Attributes

Supertypes
trait DiffTree
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object DiffOutcome

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait DiffOutcome extends Product, Serializable

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object Added
class Modified
object Removed
object Same

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def create(before: MerkleTree, after: MerkleTree): Result[DiffTree]

Constructs a DiffTree from two MerkleTree instances. The trees must have the same structure, with nodes and leaf labels being the same, otherwise this function will produce divergence error.

Constructs a DiffTree from two MerkleTree instances. The trees must have the same structure, with nodes and leaf labels being the same, otherwise this function will produce divergence error.

The resulting tree won't necessarily contain the same node structure as the input trees. The focus is on showcasing differences, so the tree is constructed lazily, accumulating differences as early as possible – early meaning "as close to the root as possible"

Value parameters

after

the "after" version of the tree

before

the "before" version of the tree

Attributes

def render(tree: DiffTree, colors: Boolean = ...): Vector[String]

Renders a DiffTree as a vector of strings, with optional color highlighting. This is not a serialisation mechanism, the tree cannot be read back from this representation.

Renders a DiffTree as a vector of strings, with optional color highlighting. This is not a serialisation mechanism, the tree cannot be read back from this representation.

Value parameters

colors

whether to use color highlighting

tree

the tree to render

Attributes

Returns

a vector of strings representing the rendered tree