OxL Reference

fn callRaw

Sends the encoded request message to rpc method of service S through its wire entry; the encoded response message or a NetError (an application error is a ProtocolError here: see callDetails).

Example:

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

service S {
  @public rpc ping() -> str
}

impl S {
  rpc ping() { "pong" }
}

fn main() io, net {
  match callRaw(S, "ping", b"") {
    bytes b => print("reply of {b.len() > 0}")
    NetError e => print("failed")
  }
}
Output
reply of true
@intrinsic("rpc.callRaw") pub(api) fn callRaw(S: type, method: str, request: bytes) -> bytes | NetError  net

Since. 1.0.0-beta

Parameters

NameType
Stype
methodstr
requestbytes

Returns

bytes

Errors

  • NetError
  • `NetError`; an application error of the handler is reported as `ProtocolError` (read it with `callDetails`).

Effects

net

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

See also