data Handle
Handle of a spawned task (§8.3).
Example:
fn work(n: i64) -> i64 time {
sleep(10ms)
n + 1
}
fn main() io, time {
scope {
let h = spawn work(1)
print("{h.join()!}")
}
}Вывод
2
@builtin("Handle") pub(api) data Handle<T, E>Потокобезопасность. `join` and `cancel` may be called from the task that owns the scope.
С версии. 1.0.0-beta
Методы
Определено в: std/core/types.oxl:417