Skip to main content

Module json_rpc

Module json_rpc 

Source
Expand description

JSON-RPC 2.0 types used by the ACP session layer.

Ported from packages/core/src/json-rpc.ts. result/params/data are opaque JSON (serde_json::Value). JSON-RPC errors are NOT Rust Err; session methods return a JsonRpcResponse whose error field may be populated.

Structs§

AcpTimeoutErrorData
Structured data for an ACP timeout error (kind: "acp_timeout").
JsonRpcError
A JSON-RPC 2.0 error object. data may carry an AcpTimeoutErrorData or arbitrary JSON.
JsonRpcNotification
A JSON-RPC 2.0 notification (no id). params is opaque JSON.
JsonRpcResponse
A JSON-RPC 2.0 response. result and error are mutually exclusive in practice but both are optional on the wire.
UnknownSessionErrorData
Structured data for an “unknown session” error (kind: "unknown_session").

Enums§

JsonRpcId
A JSON-RPC id: a number, a string, or null.

Functions§

is_unknown_session
Whether a JSON-RPC error’s data is an UnknownSessionErrorData (discriminated by kind == "unknown_session"; sessionId is optional). Mirrors the TS isUnknownSessionErrorData() discriminator.