Skip to main content

Module cluster

Module cluster 

Source
Expand description

Nested and flat cluster representations and conversions between them.

Cluster is the nested form emitted by --format=json; each cluster carries its own clusters array of children. FlatCluster is the §7.1 flat form emitted by --format=json-flat; each cluster carries a parent_id reference instead.

to_flat flattens a nested tree; from_flat reconstructs the nested tree from a flat list. The two forms are equivalent.

Structs§

Cluster
Nested cluster form (§7).
FlatCluster
Flat cluster form (§7.1).

Functions§

from_flat
Reconstruct a nested cluster tree from the §7.1 flat form.
to_flat
Flatten a nested cluster tree into the §7.1 flat form.