Skip to main content

Module delete

Module delete 

Source
Expand description

The delete family: the emitters that remove what a gesture deleted, and the closure they all walk.

A delete cascades — a block takes its subtree and everything those blocks own, a pin takes the wires landing on it, a wire takes its labels — and the whole closure is emitted as explicit Crud::Delete ops, per the compound-operation rule: a gesture lands as the primitive ops it produced. The cascade is also what keeps the fold’s endpoint check unreachable: a pin may not leave under a wire the same commit does not take with it.

Structs§

Closure 🔒
Everything a set of roots takes with it: the transitive closure over containment (a block’s subtree and its contents) and wire adjacency (a pin’s routes, a route’s labels). Held entities only, each listed once, blocks ordered ancestors first and every other kind by id — so a gesture’s ops read the same on every run.

Enums§

Target
What a delete gesture names. No icon variant: an icon is a value on its block, zeroed by assets::delete_icon rather than deleted.

Functions§

by_depth 🔒
The cascade’s blocks, ancestors first — the order a paste needs, and the reverse of the one a delete emits.
closure 🔒
Everything a delete of targets would take: the closure over the roots the document lets go of. Shared with the clipboard (10g) — a cut copies exactly what it deletes.
deletable 🔒
A locked block freezes its pin interface, so a pin named on one declines by itself and the rest of the gesture proceeds. The block itself is never frozen against deletion — nor are the pins it takes down with it.
depth 🔒
How many blocks a block sits inside. The fold refuses parent cycles (FoldError::BlockCycle), so walking up always reaches the root.
held 🔒
Whether the document still holds the target: an id it never held and one a previous commit removed are the same absence, and the fold refuses a delete at either.
selection
Inventory row “Delete Selection”: one commit for a whole selection, dispatching over the rows below. The closure owns the dedupe, so a selection holding both a block and its own child deletes each thing once.
sorted 🔒