MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / load

Method load

crates/chat-cli/src/cli/chat/tools/todo.rs:60–67  ·  view source on GitHub ↗

Loads a TodoListState with the given id

(os: &Os, id: &str)

Source from the content-addressed store, hash-verified

58
59 /// Loads a TodoListState with the given id
60 pub async fn load(os: &Os, id: &str) -> Result<Self> {
61 let state_str = os
62 .fs
63 .read_to_string(id_to_path(os, id)?)
64 .await
65 .map_err(|e| eyre!("Could not load todo list: {e}"))?;
66 serde_json::from_str::<Self>(&state_str).map_err(|e| eyre!("Could not deserialize todo list: {e}"))
67 }
68
69 /// Saves this TodoListState with the given id
70 pub async fn save(&self, os: &Os, id: &str) -> Result<()> {

Callers 1

update_stateMethod · 0.45

Calls 2

id_to_pathFunction · 0.85
read_to_stringMethod · 0.80

Tested by

no test coverage detected