fn shield
Runs body protected from cancellation (§8.6).
Example:
fn main() io {
let r = shield(() => 6 * 7)
print("{r}")
}Output
42
@intrinsic("shield") pub(api) fn shield<T, effect F>(body: fn() -> T F) -> T FSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
body | fn() -> T F |
Returns
T F
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/task.oxl:152