Esc

send_bytes

procedureextensionsince 0.36.1Source
  • macOS: send_bytes works on macOS
  • Linux: send_bytes works on Linux
  • Windows: send_bytes works on Windows
  • Wasm: send_bytes works on Wasm

Sends an owned-by-caller encoded Protobuf message. Framing owns a temporary copy only until this operation returns. One sender may coexist with one receiver. .

Signature

send_bytes :: (
    call: *Call,
    message: [] u8,
    options := Send_Options.{}
) -> Status
Example
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);
status = send_bytes(*call, u8.[10, 3, 65, 100, 97]);
assert(status.code == .OK);

See also