Skip to main content

apply_context

Function apply_context 

Source
pub fn apply_context(
    ctx: EffectiveContext,
) -> (Option<String>, Option<Vec<String>>, Option<HashMap<String, String>>)
Expand description

Convert a resolved crate::context::EffectiveContext into the three optional fields that are stamped onto a StreamEventRequest.

  • flow_id — taken directly from ctx.flow_id
  • labels — None when the vec is empty, Some(vec) otherwise
  • params — None when the map is empty, Some(HashMap) otherwise (BTreeMap → HashMap conversion)

This is a pure function so it can be unit-tested without I/O.