(&self, path: &str)
| 76 | } |
| 77 | |
| 78 | pub async fn load_string(&self, path: &str) -> Result<Option<String>, String> { |
| 79 | match self.load_bytes(path).await? { |
| 80 | Some(bytes) => { |
| 81 | let content = String::from_utf8(bytes) |
| 82 | .map_err(|e| format!("Invalid UTF-8 data: {e}"))?; |
| 83 | Ok(Some(content)) |
| 84 | } |
| 85 | None => Ok(None), |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | pub async fn load_bytes(&self, path: &str) -> Result<Option<Vec<u8>>, String> { |
| 90 | #[cfg(not(target_arch = "wasm32"))] |
nothing calls this directly
no test coverage detected