MCPcopy Create free account
hub / github.com/PerroEngine/Perro / load_string

Function load_string

perro_source/api_modules/perro_web/src/storage.rs:22–29  ·  view source on GitHub ↗
(scope: StorageScope, key: &str)

Source from the content-addressed store, hash-verified

20}
21
22pub fn load_string(scope: StorageScope, key: &str) -> io::Result<Option<String>> {
23 let Some(bytes) = load_bytes(scope, key)? else {
24 return Ok(None);
25 };
26 let text =
27 String::from_utf8(bytes).map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
28 Ok(Some(text))
29}
30
31pub fn save_string(scope: StorageScope, key: &str, text: &str) -> io::Result<()> {
32 save_bytes(scope, key, text.as_bytes())

Callers 11

reload_scene_pathFunction · 0.50
unique_panim_object_nameFunction · 0.50
save_all_scenesFunction · 0.50
open_projectFunction · 0.50
open_scene_pathFunction · 0.50
open_animation_pathFunction · 0.50
text_asset_previewFunction · 0.50
panim_summaryFunction · 0.50
load_recent_projectsFunction · 0.50

Calls 1

load_bytesFunction · 0.70

Tested by

no test coverage detected