Skip to main content

JSONRPC_VERSION

Constant JSONRPC_VERSION 

Source
pub const JSONRPC_VERSION: &str = "2.0";
Expand description

JSON‑RPC 2.0 core types for Greentic plugins communicated over stdin/stdout.

These structs intentionally mirror the JSON‑RPC 2.0 spec. They are transport‑agnostic and can be reused for HTTP, WebSocket, or gRPC (via prost → JSON) if needed.

Usage example (with serde_json):

use serde_json::json;
use greentic_plugin::jsonrpc::{Id, Request};

let req = Request::call(Id::Number(1), "messageIn", Some(json!({"text": "hi"})));
let s = serde_json::to_string(&req).unwrap();