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:
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")
}
}Вывод
reply of true
@intrinsic("rpc.callRaw") pub(api) fn callRaw(S: type, method: str, request: bytes) -> bytes | NetError netС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
S | type |
method | str |
request | bytes |
Возвращает
bytes
Ошибки
NetError- `NetError`; an application error of the handler is reported as `ProtocolError` (read it with `callDetails`).
Эффекты
net
Определено в: std/rpc/rpc.oxl:207