| 834 | /// voluntarily, and this is not an error. |
| 835 | #[allow(unused_mut)] |
| 836 | pub async fn disable(mut self, reason: &str) -> Result<(), anyhow::Error> { |
| 837 | self.output |
| 838 | .lock() |
| 839 | .await |
| 840 | .send(json!( |
| 841 | { |
| 842 | "jsonrpc": "2.0", |
| 843 | "id": self.init_id, |
| 844 | "result": crate::messages::InitResponse{ |
| 845 | disable: Some(reason.to_string()) |
| 846 | } |
| 847 | } |
| 848 | )) |
| 849 | .await |
| 850 | .context("sending init response")?; |
| 851 | Ok(()) |
| 852 | } |
| 853 | |
| 854 | pub fn option_str(&self, name: &str) -> Result<Option<options::Value>> { |
| 855 | self.option_values |