19 releases

0.9.0 Jan 7, 2026
0.8.0 Jan 9, 2025
0.7.1 Jul 2, 2024
0.7.0 Mar 25, 2024
0.2.1 Jul 28, 2022

#1428 in Network programming

Download history 168/week @ 2025-12-28 967/week @ 2026-01-04 1224/week @ 2026-01-11 1441/week @ 2026-01-18 998/week @ 2026-01-25 1542/week @ 2026-02-01 1962/week @ 2026-02-08 1877/week @ 2026-02-15 1591/week @ 2026-02-22 2596/week @ 2026-03-01 3150/week @ 2026-03-08 3577/week @ 2026-03-15 3779/week @ 2026-03-22 4323/week @ 2026-03-29 4369/week @ 2026-04-05 4850/week @ 2026-04-12

17,453 downloads per month

MIT license

25KB
602 lines

Json RPC extractor for axum

JsonRpcExtractor parses JSON-RPC requests and validates it's correctness.

use axum_jrpc::{JrpcResult, JsonRpcExtractor, JsonRpcResponse};

fn router(req: JsonRpcExtractor) -> JrpcResult {
    let req_id = req.get_answer_id()?;
    let method = req.method();
    let response =
        match method {
            "add" => {
                let params: [i32; 2] = req.parse_params()?;
                JsonRpcResponse::success(req_id, params[0] + params[1]);
            }
            m => req.method_not_found(m)
        };

    Ok(response)
}

Crates.io Documentation

Dependencies

~9–13MB
~165K SLoC