1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! JSON-RPC method handlers.
//!
//! Each submodule covers one interface group (plugin, hash, cipher, …).
//! Handlers are plain async functions that take the daemon-owned
//! [`Confium`] and the parsed params, returning a JSON result value or
//! an [`RpcError`].
//!
//! Methods that mirror C-FFI calls that are not yet wired in
//! `confium-core` use the [`pending_method!`] macro below. As the core
//! lands each interface, the matching handler becomes a thin adapter —
//! no dispatch change is needed.
/// Generate an async stub handler that returns an `Engine` error with
/// the given `(method_name, reason)` pair.
///
/// Why a macro: 29 daemon handlers across 7 modules all returned
/// the same boilerplate ("X requires Y (pending)"). The macro keeps
/// the message format consistent and the call site one line. Each
/// pending handler is its own `pub async fn` so the dispatch table
/// (which takes function pointers) sees them as first-class items.
///
/// When a handler moves from pending to real, delete the macro
/// invocation and write the real `pub async fn` in its place.