Skip to main content

Module error

Module error 

Source
Expand description

Operator factory errors (Slice H /qa F7, 2026-05-07).

Factory functions in this crate enforce two kinds of invariants:

  1. Core-layer construction invariants — already typed via graphrefly_core::RegisterError (unknown dep, terminal-non- resubscribable dep, operator without deps, sentinel seed, etc.).
  2. Factory-shape invariants — pre-conditions on the factory arguments that Core can’t see because the factory hasn’t yet constructed the graphrefly_core::OperatorOp descriptor (or the Core check would fire with the wrong error message). Examples:
    • combine(sources, packer) requires !sources.is_empty() (Core would surface the same condition as OperatorWithoutDeps, but the factory error is named after the public API).
    • last_with_default(source, default) requires default != NO_HANDLE — Core accepts Last { default: NO_HANDLE } as the no-default variant (used by last()), so the factory must enforce its tighter contract.

Both kinds funnel through OperatorFactoryError so factory callers handle a single error enum. The Core variant is transparent-wrapped: ? propagation from register_operator(...)? works directly via the auto-derived From<RegisterError> impl.

Enums§

OperatorFactoryError
Errors returnable by crate::combine, crate::merge, [crate::merge_as_op], crate::last_with_default, and [crate::last_with_default_with].