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

Method open

crates/chat-cli/src/os/fs/mod.rs:155–161  ·  view source on GitHub ↗

Attempts to open a file in read-only mode. This is a proxy to [`tokio::fs::File::open`].

(&self, path: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

153 ///
154 /// This is a proxy to [`tokio::fs::File::open`].
155 pub async fn open(&self, path: impl AsRef<Path>) -> io::Result<fs::File> {
156 match self {
157 Self::Real => fs::File::open(path).await,
158 Self::Chroot(root) => fs::File::open(append(root.path(), path)).await,
159 Self::Fake(_) => Err(io::Error::other("unimplemented")),
160 }
161 }
162
163 pub async fn read(&self, path: impl AsRef<Path>) -> io::Result<Vec<u8>> {
164 match self {

Callers 2

initialize_loggingFunction · 0.80
save_to_fileMethod · 0.80

Calls 2

appendFunction · 0.70
pathMethod · 0.45

Tested by

no test coverage detected