Load from URL (blocking GET).
(url: &str)
| 119 | |
| 120 | /// Load from URL (blocking GET). |
| 121 | pub fn from_url(url: &str) -> Result<Self, String> { |
| 122 | let client = reqwest::blocking::Client::new(); |
| 123 | let json = client |
| 124 | .get(url) |
| 125 | .send() |
| 126 | .map_err(|e| e.to_string())? |
| 127 | .text() |
| 128 | .map_err(|e| e.to_string())?; |
| 129 | Self::new(&json) |
| 130 | } |
| 131 | |
| 132 | /// Default inactive config. |
| 133 | pub fn default_config() -> Self { |