Thanks to visit codestin.com
Credit goes to lib.rs

10 releases (6 major breaking)

Uses new Rust 2024

new 11.0.0-alpha.1 Jan 19, 2026
10.0.0 Dec 30, 2025
9.0.0 Dec 19, 2025
8.0.0 Dec 17, 2025
2.0.1 Dec 12, 2025

#7 in #rpc-response

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

16,768 downloads per month
Used in 18 crates (via sacp)

MIT/Apache

12KB
210 lines

Derive macros for SACP JSON-RPC traits.

This crate provides derive macros to reduce boilerplate when implementing custom JSON-RPC requests, notifications, and response types.

Example

use sacp::{JsonRpcRequest, JsonRpcNotification, JsonRpcResponse};

#[derive(Debug, Clone, Serialize, Deserialize, JsonRpcRequest)]
#[request(method = "_hello", response = HelloResponse)]
struct HelloRequest {
    name: String,
}

#[derive(Debug, Serialize, Deserialize, JsonRpcResponse)]
#[response(method = "_hello")]
struct HelloResponse {
    greeting: String,
}

#[derive(Debug, Clone, Serialize, Deserialize, JsonRpcNotification)]
#[notification(method = "_ping")]
struct PingNotification {
    timestamp: u64,
}

Using within the sacp crate

When using these derives within the sacp crate itself, add crate = crate:

#[derive(JsonRpcRequest)]
#[request(method = "_foo", response = FooResponse, crate = crate)]
struct FooRequest { ... }

Dependencies

~145–540KB
~13K SLoC