fn asService
Runs body as this node's own service (§13.2): the calls it makes carry the service principal instead of the original user.
Example:
use std.rpc { asService }
fn main() io {
let n = asService { 7 }
print("{n}")
}Вывод
7
pub(api) fn asService<T, effect F>(body: fn() -> T F) -> T FС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
body | fn() -> T F |
Возвращает
T F
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/rpc/rpc.oxl:342