def FailurePolicy.result

bend-trace-context@0.2.0.0 · trace_context.bend:3473

import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base

3473# The type an operation returns under `policy`: the value itself with
3474# Lenient{}, and the value or the GenerationError with Strict{}.
3475def FailurePolicy.result(policy: FailurePolicy, A: Data) -> Data:
3476  match policy:
3477    case Lenient{}:
3478      A
3479    case Strict{}:
3480      Result<&2, &2, GenerationError, A>

Uses (3)

Used by (12)