bitcoind_json_rpc_client/client_sync/v17/
control.rs

1// SPDX-License-Identifier: CC0-1.0
2
3//! Macros for implementing JSON-RPC methods on a client.
4//!
5//! Specifically this is methods found under the `== Control ==` section of the
6//! API docs of `bitcoind v0.17.1`.
7//!
8//! All macros require `Client` to be in scope.
9//!
10//! See or use the `define_jsonrpc_minreq_client!` macro to define a `Client`.
11
12/// Implements bitcoind JSON-RPC API method `getmemory`
13#[macro_export]
14macro_rules! impl_client_v17__getmemoryinfo {
15    () => {
16        impl Client {
17            pub fn get_memory_info(&self) -> Result<GetMemoryInfoStats> {
18                self.call("getmemoryinfo", &[])
19            }
20        }
21    };
22}
23
24/// Implements bitcoind JSON-RPC API method `logging`
25#[macro_export]
26macro_rules! impl_client_v17__logging {
27    () => {
28        impl Client {
29            pub fn logging(&self) -> Result<Logging> { self.call("logging", &[]) }
30        }
31    };
32}
33
34/// Implements bitcoind JSON-RPC API method `stop`
35#[macro_export]
36macro_rules! impl_client_v17__stop {
37    () => {
38        impl Client {
39            pub fn stop(&self) -> Result<String> { self.call("stop", &[]) }
40        }
41    };
42}
43
44/// Implements bitcoind JSON-RPC API method `uptime`
45#[macro_export]
46macro_rules! impl_client_v17__uptime {
47    () => {
48        impl Client {
49            pub fn uptime(&self) -> Result<u32> { self.call("uptime", &[]) }
50        }
51    };
52}