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

Method read

crates/chat-cli/src/os/fs/mod.rs:163–177  ·  view source on GitHub ↗
(&self, path: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

161 }
162
163 pub async fn read(&self, path: impl AsRef<Path>) -> io::Result<Vec<u8>> {
164 match self {
165 Self::Real => fs::read(path).await,
166 Self::Chroot(root) => fs::read(append(root.path(), path)).await,
167 Self::Fake(map) => {
168 let Ok(lock) = map.lock() else {
169 return Err(io::Error::other("poisoned lock"));
170 };
171 let Some(data) = lock.get(path.as_ref()) else {
172 return Err(io::Error::new(io::ErrorKind::NotFound, "not found"));
173 };
174 Ok(data.clone())
175 },
176 }
177 }
178
179 pub async fn read_to_string(&self, path: impl AsRef<Path>) -> io::Result<String> {
180 match self {

Callers 15

initMethod · 0.80
pending_clientsMethod · 0.80
status_all_agentsFunction · 0.80
queue_descriptionMethod · 0.80
invokeMethod · 0.80
get_agent_by_nameMethod · 0.80
loadMethod · 0.80
executeMethod · 0.80
load_from_fileMethod · 0.80
migrateFunction · 0.80
calculate_sha256Method · 0.80

Calls 5

appendFunction · 0.70
pathMethod · 0.45
getMethod · 0.45
as_refMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected