MCPcopy Create free account
hub / github.com/bajrangCoder/setu / load

Method load

src/assets.rs:12–20  ·  view source on GitHub ↗
(&self, path: &str)

Source from the content-addressed store, hash-verified

10
11impl AssetSource for Assets {
12 fn load(&self, path: &str) -> anyhow::Result<Option<Cow<'static, [u8]>>> {
13 if path.is_empty() {
14 return Ok(None);
15 }
16
17 Self::get(path)
18 .map(|f| Some(f.data))
19 .ok_or_else(|| anyhow!("could not find asset at path \"{}\"", path))
20 }
21
22 fn list(&self, path: &str) -> anyhow::Result<Vec<SharedString>> {
23 Ok(Self::iter()

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected