Register a custom RPC method for the RPC passthrough from the main daemon
(mut self, name: &str, description: &str, callback: C)
| 176 | /// Register a custom RPC method for the RPC passthrough from the |
| 177 | /// main daemon |
| 178 | pub fn rpcmethod<C, F>(mut self, name: &str, description: &str, callback: C) -> Builder<S, I, O> |
| 179 | where |
| 180 | C: Send + Sync + 'static, |
| 181 | C: Fn(Plugin<S>, Request) -> F + 'static, |
| 182 | F: Future<Output = Response> + Send + Sync + 'static, |
| 183 | { |
| 184 | self.rpcmethods.insert( |
| 185 | name.to_string(), |
| 186 | RpcMethod { |
| 187 | name: name.to_string(), |
| 188 | description: description.to_string(), |
| 189 | callback: Box::new(move |p, r| Box::pin(callback(p, r))), |
| 190 | }, |
| 191 | ); |
| 192 | self |
| 193 | } |
| 194 | |
| 195 | /// Send true value for "dynamic" field in "getmanifest" response |
| 196 | pub fn dynamic(mut self) -> Builder<S, I, O> { |