Skip to main content

Module handle

Module handle 

Source
Expand description

Identifier newtypes — the handle-protocol’s core type vocabulary.

Mirrors ~/src/graphrefly-ts/src/__experiments__/handle-core/core.ts:52–57 under Rust’s stricter type discipline (CLAUDE.md Rust invariant 8 — no raw integers in public APIs).

§Cleaving plane

  • NodeId — identifies a node in the graph. Allocated by the Core; opaque to bindings.
  • HandleId — identifies a user value T in the binding-side registry. The Core never sees T; equals-substitution under equals: identity is a u64 compare on HandleId (zero FFI). Custom equals crosses the boundary explicitly via crate::boundary::BindingBoundary::custom_equals.
  • FnId — identifies a user function (or a custom-equals oracle) in the binding-side registry.
  • LockId — identifies a pause-lock. Multiple pausers can hold distinct locks on the same node; the node remains paused until the lockset is empty (R1.2.6, R2.6).

All four are u64 newtypes for cheap hashing, atomic increments, and lock-free version counters. They are intentionally NOT interconvertible — NodeId(7) and HandleId(7) are different things.

Structs§

FnId
Identifier for a user function (or a custom-equals oracle) in the binding-side registry.
HandleId
Identifier for a user value T in the binding-side registry.
LockId
Identifier for a pause-lock.
NodeId
Identifier for a node in the Core’s dispatcher.

Constants§

NO_HANDLE
Sentinel “no handle” — distinct from any valid handle (which start at 1).