TraceContext.Context.root_with: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 1518-1530 of bend-trace-context@0.2.0.0/trace_context.bend: https://jend.leeeet.dev/read.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&start_line=1518&end_line=1530 import Base # Generated contexts from a caller's source. `read` returns the source's next # state with each word result. The source is trusted to be random: a generated # trace ID asserts random-trace-id. A root is a trace ID, with none to # exclude, then a span ID: TraceId.generate_with, then SpanId.generate_with # from the source's next state (TracePlan.root and TracePlan.generate_with). # It reads at most 48 words and has the sampled indication `sampled`, as it # is given: no default applies here, and False gives an unsampled root, # emitted with flags 02, as Context.continue_or_start_with starts one by # default (spec #41, "Sampling decision when starting a trace"). Laws: # root_composed, root_tape, root_ends, root_exhaustion and generated_root. def Context.root_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), source: S, sampled: Bool) -> IO(S & Result<&2, &2, GenerationError, LocalContext>): TracePlan.generate_with(~S, ~read, source, TracePlan.root(sampled)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=GenerationError https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=LocalContext https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TracePlan.generate_with https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TracePlan.root