Declaration
Receive_Kind :: enum u8 {
MESSAGE; END; ERROR;}MESSAGE carries one owned message. On clients, END and ERROR still require finish to obtain the authoritative RPC status.
channel: Channel; // set transport.base_url and transport.tls before the first call
method := Method.{ path = "/echo.Echo/Say" };
call, status := open_call(*channel, method);
assert(status.code == .OK);
defer close(*call);
message, kind := receive_bytes(*call);
if kind == .MESSAGE free(message.data);
final := finish(*call); // the authoritative result, also after .END or .ERROR
defer free_status(*final);