Skip to main content

decoration_from_wit

Function decoration_from_wit 

Source
pub fn decoration_from_wit(
    wit: GutterDecoration,
    registry: &SignRegistry,
) -> Result<Option<GutterDecoration>, String>
Expand description

SG.3b — the registry-aware guest→host conversion, and the one the producer call site uses.

Ok(None) means the placement is SKIPPED, which happens for exactly one reason: the guest named a sign nothing has defined. That is the same answer the native render path gives an unknown id — paint nothing — and it is deliberately not an Err, because an Err fails the whole batch and would take the plugin’s diff and severity marks down with it over one unregistered name. A definition that has not registered yet is recoverable; a malformed record is not, and those still fail.

The resolution happens HERE, at the boundary, off the render path — which is the whole reason a native placement can stay Copy and carry no per-line String.