Skip to main content

list_installed_schemes

Function list_installed_schemes 

Source
pub fn list_installed_schemes(
    store: &Store,
    dir: &Path,
) -> Result<Vec<NodeCatalogEntry>, NodeError>
Expand description

The canvas runtime’s view of “what kinds exist”: for every row in node_library, read the on-disk scheme. The scheme is the source of truth at runtime - the embedded catalog only seeds new installs.

Self-healing: a row whose scheme file is genuinely gone (NotFound) is an unusable orphan - typically left behind by an old slug rename - so the row is dropped rather than warned about on every boot. This prune only runs when dir is a readable directory: if the whole nodes dir is missing or unmounted, every scheme reads as NotFound, and mistaking that for “everything uninstalled” would wipe the registry. Any other read failure (a present-but-corrupt file) is logged and skipped - not fatal, not pruned - so a single bad scheme can’t blank the palette or lose a row.