Expand description
GraphReFly Graph container — sugar layer over graphrefly_core::Core
with named namespace, mount/unmount composition, describe() JSON
introspection, and observe() sink-style message tap.
§Status
M2 complete: Graph container, mount/unmount, namespace resolution,
describe() / observe(), snapshot round-trip (see migration-status
D276+). Deferred presentation-tier observe modes stay binding-side;
open substrate gaps are listed in docs/porting-deferred.md.
Binding-side / post-1.0 (not this crate): render formats (pretty /
mermaid / d2), DS-14 mutate() factory, cross-Core mount.
§Crate lints
#![forbid(unsafe_code)] per workspace policy.
Structs§
- Edge
Describe - Edge between two named nodes (or a named node and an empty-string rendering of an unnamed dep — D301 B, 2026-05-26).
- Graph
- Graph container — the one Core-free namespace + mount-tree handle (canonical §3, D246).
- Graph
Describe Output - Top-level
describe()output (canonical Appendix B JSON schema). - Graph
Inner - Inner namespace + mount-tree state for one graph level. D246: holds
no
Core— purely the named namespace, the mounted children, and the namespace-change sinks. D246/S2c/D247: single-owner ⇒Rc<RefCell<GraphInner>>(the priorArc<Mutex<…>>was shared-Core-era legacy); the shareable-handle + parent-Weakcycle stays, single-threaded. - Graph
Observe All - All-nodes observe handle. Subscriptions are tied to the set of
nodes named at
subscribe()call time. D246: no RAIIDrop— You MUST callSelf::detach(core)(owner-invoked) — these Core subscriptions are opened via rawcore.subscribeand are NOTOwnedCore-tracked, so dropping the handle withoutdetachleaks them for theCorelifetime. - Graph
Observe AllReactive - Reactive
observe_all— auto-subscribes late-added named nodes via the owner-side namespace-change listener, and prunes torn-down nodes via the Core topology sub (the pruneunsubscribeisMailboxOp::Defer’d sinceNodeTornDownfires in-wave — D246 r6). D246 rule 3: no RAIIDrop; teardown is the owner-invokedSelf::detach(core)— owner-invoked, REQUIRED. The ns-sink is collected bygraph.destroy(core); the Core topology sub + fan-out subs are opened via rawcore.subscribe*and are NOTOwnedCore-tracked, sodetach(core)is the only thing that collects them (dropping the handle without it leaks them). - Graph
Observe One - Single-node observe handle (canonical §3.6.2).
- Graph
Persist Snapshot - Portable snapshot of a graph’s state.
- Graph
Profile Options - Options for
Graph::resource_profile. - Graph
Profile Result - Aggregate profile returned by
Graph::resource_profile. Mirrors the post-D284 narrowerpackages/parity-tests/impls/types.tsImplGraphProfileResultshape (nototalValueSizeBytes, nohotspots.byValueSize). JSON keys are camelCase to match the cross-arm parity wire contract. - Graph
Remove Audit - Result of
Graph::unmount/Graph::remove. - Hotspots
- Top-N hotspots returned by
GraphProfileResult::hotspots. D284 dropped theby_value_sizeranking (see [crate::profile] module docstring for the rationale). JSON keys are camelCase (bySubscriberCount/byDepCount) to match the cross-arm parity wire contract. - Node
Describe - Per-node descriptor.
- Node
Profile - Per-node profile entry. Mirrors the post-D284 narrower
packages/parity-tests/impls/types.tsImplNodeProfileshape exactly (novalueSizeBytes). - Node
Slice - Per-node state within a snapshot.
- Observe
Sub - Id pair for a single observe subscription. D246: a plain value (no
Drop); detach explicitly viaSelf::detachor let the embedder’sOwnedCoretear down on owner-thread drop. - Reactive
Describe Handle - Id-bearing handle for a reactive describe subscription.
Enums§
- Describe
Value - Per-node cache value in
describeoutput. Serialized uniformly without an enum tag. - Mount
Error - Errors from
mount/mount_new/unmount. - Name
Error - Errors from name registration.
- Node
Snapshot Status - Lifecycle status stored in a snapshot.
- Node
Status - Canonical Appendix B
statusenum. - Node
Type Str - Canonical Appendix B
typeenum. - Orphan
Kind - Orphan classification for a
NodeProfile.Nonewhen the node has at least one subscriber, or when it is astatenode (state has no fn to be “idle” about — excluded by construction atprofile.ts:129-138). - Path
Error - Path resolution errors returned by
Graph::try_resolve_checked. - Remove
Error - Errors from
Graph::remove. - Signal
Kind - Signal kind for
Graph::signal(canonical R3.7.1). - Snapshot
Error - Errors from
Graph::restoreandGraph::from_snapshot.
Traits§
- Debug
Binding Boundary - Render handles into JSON-shaped debug values.
Type Aliases§
- Describe
Sink - Sink type for reactive describe. D272 (2026-05-21): single-owner-
thread shape —
Rc<dyn Fn>matches D248’s!Send + !SyncCore. Theassert_not_impl_any!below locks D248 intent at the type system. - Node
Factory - Factory for auto-hydration mode. D246: receives the embedder’s
&Core+ the Core-freeGraphhandle. - Snapshot
Builder - Builder function for
Graph::from_snapshotbuilder mode (D246:&Core+ Core-freeGraph).