def Scan.result
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
2263# The state read, once the last member has ended. TraceState.is_valid is
2264# checked here to build the state's evidence.
2265def Scan.result(scan: Scan) -> Result<&2, &2, StateError, TraceState>:
2266 match scan:
2267 case Stopped{error}:
2268 Fail{error}
2269 case Scanning{member, room, current, +entries}:
2270 Scan.state(entries, TraceState.is_valid(entries), {==})