def SpanPlan.generate_with
bend-trace-context@0.2.0.0 · trace_context.bend:1483
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base
1483
1484
1485
1486def SpanPlan.generate_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), source: S,
1487 plan: SpanPlan) -> IO(S & Result<&2, &2, GenerationError, LocalContext>):
1488 match plan:
1489 case SpanPlan{excluded, trace_id, sampled}:
1490 IO.bind(S & Result<&2, &2, GenerationError, SpanId>, S & Result<&2, &2, GenerationError, LocalContext>,
1491 SpanId.generate_with(~S, ~read, source, excluded),
1492 outcome => IO.pure(S & Result<&2, &2, GenerationError, LocalContext>,
1493 Draw.span_context(S, trace_id, sampled, outcome)))