MCPcopy Create free account
hub / github.com/AI45Lab/Code / read_text

Method read_text

core/src/workspace/local.rs:83–96  ·  view source on GitHub ↗
(&self, path: &WorkspacePath)

Source from the content-addressed store, hash-verified

81#[async_trait]
82impl WorkspaceFileSystem for LocalWorkspaceBackend {
83 async fn read_text(&self, path: &WorkspacePath) -> WorkspaceResult<String> {
84 let resolved = self.local_path_for_read(path)?;
85 match tokio::fs::read_to_string(&resolved).await {
86 Ok(s) => Ok(s),
87 Err(e) if e.kind() == std::io::ErrorKind::NotFound => Err(WorkspaceError::NotFound {
88 path: resolved.display().to_string(),
89 }),
90 Err(e) => Err(WorkspaceError::Backend(anyhow!(
91 "Failed to read file {}: {}",
92 resolved.display(),
93 e
94 ))),
95 }
96 }
97
98 async fn write_text(
99 &self,

Callers 1

Calls 2

local_path_for_readMethod · 0.80
kindMethod · 0.80

Tested by

no test coverage detected