(mut self, reason: &str)
| 460 | /// voluntarily, and this is not an error. |
| 461 | #[allow(unused_mut)] |
| 462 | pub async fn disable(mut self, reason: &str) -> Result<(), anyhow::Error> { |
| 463 | self.output |
| 464 | .lock() |
| 465 | .await |
| 466 | .send(json!( |
| 467 | { |
| 468 | "jsonrpc": "2.0", |
| 469 | "id": self.init_id, |
| 470 | "result": crate::messages::InitResponse{ |
| 471 | disable: Some(reason.to_string()) |
| 472 | } |
| 473 | } |
| 474 | )) |
| 475 | .await |
| 476 | .context("sending init response")?; |
| 477 | Ok(()) |
| 478 | } |
| 479 | |
| 480 | pub fn option(&self, name: &str) -> Option<options::Value> { |
| 481 | self.options |