MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / load_string

Method load_string

src/storage.rs:78–87  ·  view source on GitHub ↗
(&self, path: &str)

Source from the content-addressed store, hash-verified

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"))]

Callers

nothing calls this directly

Calls 1

load_bytesMethod · 0.80

Tested by

no test coverage detected