Skip to main content

last_with_default

Function last_with_default 

Source
pub fn last_with_default(
    core: &Core,
    source: NodeId,
    default: HandleId,
) -> Result<FlowRegistration, OperatorFactoryError>
Expand description

last_with_default(source, default) — buffers the latest DATA; emits Data(latest) then Complete on upstream COMPLETE. On empty stream (no DATA arrived), emits Data(default) then Complete.

Core takes one retain on default for the LastState’s lifetime; the caller should retain a share for themselves if they want to reference the handle elsewhere.

§Errors