TraceContext.TraceId.generate_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 1127-1140 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=1127&end_line=1140 import Base # A trace ID alone, from a caller's source, as an OpenTelemetry SDK generates # one before its sampler decides on it. `read` returns the source's next state # with each word result, and the source's final state is returned. It reads # four words per candidate, most significant first, for at most eight # candidates, so at most 32 words; rejects all-zero candidates and `excluded`, # when there is one; and fails with SourceFailure or ExhaustedTraceId. The # source is trusted to be random: the trace ID asserts random-trace-id. # Laws: trace_id_tape, trace_id_failure, trace_id_candidate, trace_id_ends, # trace_id_exhaustion and generated_trace_id. def TraceId.generate_with(~S: Type, ~read: S -> IO(S & Result<&1, &1, U32 & String, U32>), source: S, excluded: Maybe<&2, TraceId>) -> IO(S & Result<&2, &2, GenerationError, TraceId>): +start = TraceDraw.start(excluded) Drive.finished(~TraceStep, ~TraceId, ~TraceDraw.result, ~S, Drive.read(~TraceStep, ~TraceDraw, ~TraceStep.waiting, ~TraceDraw.next, ~S, ~read, 32n, (source, (start, TraceStep.waiting(start))))) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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=Sigma 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=Drive.finished https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Drive.read 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=TraceDraw https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceDraw.next https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceDraw.result https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceDraw.start https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceId https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceStep https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceStep.waiting