Module Result.Capsule

module Capsule := Portable.Capsule.Expert
type 'a t =
  1. | Ok : ('a, 'k) Capsule.Data.t * 'k Capsule.Key.t -> 'a t
  2. | Exn of Base.Exn.t * Base.Backtrace.t
val try_with : (Base.unit -> 'a) @ local once portable -> 'a t @ local unique

try_with f runs f in a fresh capsule, returning Exn if f raises and Ok otherwise.

val unwrap_ok_exn : 'a t @ local unique -> 'a
val globalize : 'a t @ local unique -> 'a t @ unique