OxL Reference

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:

oxl✓ checked in CI
use std.rpc { asService }

fn main() io {
  let n = asService { 7 }
  print("{n}")
}
Output
7
pub(api) fn asService<T, effect F>(body: fn() -> T F) -> T  F

Since. 1.0.0-beta

Parameters

NameType
bodyfn() -> T F

Returns

T F

Effects

none declared (pure unless the body says otherwise)

Defined in: std/rpc/rpc.oxl:342

See also