Skip to main content

SetDepsError

Enum SetDepsError 

Source
pub enum SetDepsError {
    SelfDependency {
        n: NodeId,
    },
    WouldCreateCycle {
        n: NodeId,
        added_dep: NodeId,
        path: Vec<NodeId>,
    },
    UnknownNode(NodeId),
    NotComputeNode(NodeId),
    TerminalNode {
        n: NodeId,
    },
    TerminalDep {
        n: NodeId,
        dep: NodeId,
    },
    ReentrantOnFiringNode {
        n: NodeId,
    },
    PartitionMigrationDuringFire {
        n: NodeId,
        firing: NodeId,
    },
}
Expand description

Errors returnable by Core::set_deps.

Per ~/src/graphrefly-ts/docs/research/rewire-design-notes.md and the Phase 13.8 Q1 lock:

  • SelfDependencyn in newDeps (self-loops are pathological without explicit fixed-point semantics, which GraphReFly does not provide).
  • WouldCreateCycle { path } — adding the new edge would create a cycle. The path field reports the offending dep chain for debuggability.
  • UnknownNode / NotComputeNode — invariant violations from the caller.
  • TerminalNoden itself has emitted COMPLETE/ERROR; rewiring a terminal stream is a category error (terminal is one-shot at this layer; recovery is the resubscribable path on a fresh subscribe).
  • TerminalDep — a newly-added dep is terminal AND not resubscribable. Resubscribable terminal deps are accepted because the subscribe path resets their lifecycle. Non-resubscribable terminal deps would deliver their already-emitted terminal directly to n’s dep_terminals slot, which is rarely intended.

Variants§

§

SelfDependency

n appeared in new_deps (self-loop rejection).

Fields

§

WouldCreateCycle

Adding the new dep would create a cycle. path is the chain [added_dep, ..., n] reachable via existing deps.

Fields

§added_dep: NodeId
§path: Vec<NodeId>
§

UnknownNode(NodeId)

§

NotComputeNode(NodeId)

§

TerminalNode

n itself has terminated (COMPLETE / ERROR). Rewiring a terminal node is rejected — the stream has ended at this layer. To recover, mark the node resubscribable before terminate; a fresh subscribe will then reset its lifecycle.

Fields

§

TerminalDep

A newly-added dep is terminal AND non-resubscribable. Per Phase 13.8 Q1, this is rejected; resubscribable terminal deps are allowed because the subscribe path resets them when activated. Already-present terminal deps are unaffected (their terminal status was accepted at the time they terminated).

Fields

§

ReentrantOnFiringNode

n itself is currently mid-fire — a user fn for n re-entered Core via set_deps(n, ...) from inside n’s own invoke_fn / project_each / predicate_each / etc. Phase 1 of the dispatcher snapshotted dep_handles BEFORE the lock-released callback; the callback returning a tracked set indexed against THAT ordering would corrupt indices if the rewire re-orders deps mid-fire. Rejected to preserve the dynamic-tracked-indices invariant (D1).

Workaround: schedule the rewire from a different node’s fn (via Core::emit on a state node and observing the emit downstream), or perform the rewire after the wave completes (e.g. from a sink callback that is itself outside any fn-fire scope).

Slice F (2026-05-07) — A6.

Fields

§

PartitionMigrationDuringFire

set_deps(n, ...) would trigger a partition migration (union or split in the per-subgraph union-find registry) that affects the partition of a node currently mid-fire on this thread. Distinct from Self::ReentrantOnFiringNode: that variant rejects set_deps(n, ...) where n itself is firing; this variant rejects set_deps(n, ...) on some OTHER node whose union/split shifts a firing node’s partition root mid-wave.

Why this matters: Y1’s wave engine holds an Arc<crate::subgraph::SubgraphLockBox> for the firing node’s partition for the wave’s duration. A union mid-wave swaps the box-identity for one of the two affected partitions; a split (Y1+ post-Phase-F) extracts a fresh box for the orphan side. Either way the held Arc would diverge from the registry’s current root for that partition, so the wave would lose serialization against the box’s true partition mid-flight.

Per SESSION-rust-port-d3-per-subgraph-parallelism.md Q3 = (a-strict): mid-wave migration is rejected at edge-mutation time. If a real consumer surfaces pressure to support mid-wave migration, lift via state-migration logic in a follow-up — but the v1 contract is “the partition a wave runs in cannot change shape mid-flight.”

n is the node whose set_deps was rejected; firing is the concretely-identified firing node whose partition would be migrated. Workaround: schedule the rewire outside the wave (e.g. emit a state-change that triggers set_deps from a sink callback running post-flush).

Slice Y1 (D3 / D091, 2026-05-08).

Fields

§firing: NodeId

Trait Implementations§

Source§

impl Clone for SetDepsError

Source§

fn clone(&self) -> SetDepsError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SetDepsError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SetDepsError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SetDepsError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for SetDepsError

Source§

fn eq(&self, other: &SetDepsError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SetDepsError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.