def Draw.root_span_with
bend-trace-context@0.2.0.0 · trace_context.bend:1495
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base
1495
1496
1497
1498
1499def Draw.root_span_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), sampled: Bool,
1500 outcome: S & Result<&2, &2, GenerationError, TraceId>) -> IO(S & Result<&2, &2, GenerationError, LocalContext>):
1501 match outcome:
1502 case Tuple{state, Fail{error}}:
1503 IO.pure(S & Result<&2, &2, GenerationError, LocalContext>, (state, Fail{error}))
1504 case Tuple{state, Done{trace_id}}:
1505 SpanPlan.generate_with(~S, ~read, state, SpanPlan.root(trace_id, sampled))