Skip to main content

pairwise

Function pairwise 

Source
pub fn pairwise<F>(
    core: &Core,
    binding: &Arc<dyn OperatorBinding>,
    source: NodeId,
    pack: F,
) -> OperatorRegistration
where F: Fn(HandleId, HandleId) -> HandleId + Send + Sync + 'static,
Expand description

pairwise(source) — emits (prev, current) pairs starting after the second value. First value is swallowed (used as prev).

The pack closure is provided by the binding-side wrapping helper — it takes two handles and returns a tuple-handle. For tests that don’t care about the pair representation, pack = |_, b| b is a valid degenerate implementation that emits the current value only; production bindings install a real pair-packer.