Guard a synchronous call. Arguments not guarded by M.raw() are
automatically hardened and must be at least Passable.
Rest ...argPatterns: any[]Guard an async call. Arguments not guarded by M.raw() are automatically
hardened and must be at least Passable.
Rest ...argGuards: any[]Guard the interface of an exo object
Generated using TypeDoc
Guard a positional parameter in
M.callWhen, awaiting it and matching its fulfillment against the provided pattern. For example,M.callWhen(M.await(M.nat())).returns()will await the first argument, check that its fulfillment satisfiesM.nat(), and only then call the guarded method with that fulfillment. If the argument is a non-promise value that already satisfiesM.nat(), then the result ofawaiting it will still pass, andM.callWhenwill still delay the guarded method call to a future turn. If the argument is a promise that rejects rather than fulfills, or if its fulfillment does not satisfy the nested pattern, then the call is rejected without ever invoking the guarded method.Any
AwaitArgGuardmay not appear as a rest pattern or a result pattern, only a top-level single parameter pattern.