Module adapter

Module adapter 

Source
Expand description

From one entity’s content projection to its nodes and tree entry.

This is the seam between the diff engine and the object layer. It takes the projection the diff engine already defines — DataFingerprintInput — and produces the nodes plus the crate::tree::TreeEntry that names them.

Reusing that input rather than restating it is deliberate: “what counts as an entity’s content” is a long argued question with its reasoning recorded in rust/diff’s own docs (a type assignment is identified by name and class, never by the type’s GlobalId; Tag participates for type objects only; absent and empty name bags are identical). Restating it here would fork that decision into two places, and the fork would be silent.

§The key does not reach a node

Every node this produces is addressed by content alone. The key arrives as a separate argument and lands only in the returned tree entry, which is the whole of the GUID-agnostic design (crate::tree). The tests assert it: the same projection under two different keys yields byte-identical node addresses.

§What this does not do yet

Geometry and relationships. DataFingerprintInput carries neither — a geometry hash reaches the diff engine through EntityFingerprint, from the mesh pass, and relationships reach it only as derived components. Both want their own adapter and are deferred rather than approximated here. The relationship adapter also has a decision to wait for: endpoints by node address drop which of two coincident duplicates the source named, and the spec set holds that equivalence policy open (02-graph-object-model.md §2.8).

Structs§

EntityNodes
One entity’s conversion: the nodes it is made of, and the entry naming it.

Enums§

AdapterError
Why an entity could not be converted.

Functions§

entity_nodes
Convert one entity.