Load from file.
(path: &Path)
| 113 | |
| 114 | /// Load from file. |
| 115 | pub fn from_file(path: &Path) -> Result<Self, String> { |
| 116 | let json = std::fs::read_to_string(path).map_err(|e| e.to_string())?; |
| 117 | Self::new(&json) |
| 118 | } |
| 119 | |
| 120 | /// Load from URL (blocking GET). |
| 121 | pub fn from_url(url: &str) -> Result<Self, String> { |