| 114 | } |
| 115 | |
| 116 | async fn testoptions(p: Plugin<()>, _v: serde_json::Value) -> Result<serde_json::Value, Error> { |
| 117 | let test_option = p.option(&TEST_OPTION)?; |
| 118 | let test_option_no_default = p.option(&TEST_OPTION_NO_DEFAULT)?; |
| 119 | let test_multi_str_option = p.option(&TEST_MULTI_STR_OPTION)?; |
| 120 | let test_multi_str_option_default = p.option(&TEST_MULTI_STR_OPTION_DEFAULT)?; |
| 121 | let test_multi_i64_option = p.option(&TEST_MULTI_I64_OPTION)?; |
| 122 | let test_multi_i64_option_default = p.option(&TEST_MULTI_I64_OPTION_DEFAULT)?; |
| 123 | |
| 124 | Ok(json!({ |
| 125 | "test-option": test_option, |
| 126 | "opt-option" : test_option_no_default, |
| 127 | "multi-str-option": test_multi_str_option, |
| 128 | "multi-str-option-default": test_multi_str_option_default, |
| 129 | "multi-i64-option": test_multi_i64_option, |
| 130 | "multi-i64-option-default": test_multi_i64_option_default, |
| 131 | })) |
| 132 | } |
| 133 | |
| 134 | async fn testmethod(_p: Plugin<()>, _v: serde_json::Value) -> Result<serde_json::Value, Error> { |
| 135 | Ok(json!("Hello")) |