Skip to main content

Module rpc

Module rpc 

Source
Expand description

RPC binding wire types.

Both the server binding (cratestack-axum::rpc) and every generated client (cratestack-client-rust, the TS / Dart generators) agree on these shapes. They live in cratestack-core so clients can depend on a single source of truth without pulling in axum.

Server-only helpers (codec-aware encoding, axum response post-processing, batch frame assembly) stay in cratestack-axum::rpc. This module owns only the wire shapes and the CoolError → gRPC-style code mapping.

Structs§

RpcErrorBody
Wire shape of a single error returned by an RPC call. Maps from CoolError via rpc_code + CoolError::public_message.
RpcRequest
Wire shape of a single batch request frame.
RpcResponseFrame
Wire shape of a single batch response frame.

Constants§

RPC_BATCH_PATH
Mount path for batched RPC calls. Body is a codec-encoded sequence of RpcRequest frames.
RPC_UNARY_PATH
Mount path for unary RPC calls. The trailing segment is the percent-decoded op id, e.g. POST /rpc/model.User.list.

Functions§

cool_error_code_to_rpc_code
Map a CoolErrorResponse.code string (screaming-snake, REST- binding vocabulary) to the stable gRPC-style code the RPC binding emits.
rpc_code
Map a CoolError to its stable RPC code (gRPC-style snake_case).