Public declaration syntax from harness-sdk/src/harness/workspace.rs Original source SHA-256: 73b639b9eceeeb2ccc14730b5fac74ca9fd376106a27e00ccc4ffbd3c2d168d3 Function bodies and constant values are omitted. This is not the complete implementation. Source line 22 #[derive(Debug, Error)] pub enum HarnessWorkspaceError { /// I/O error reaching the workspace. #[error("workspace io: {0}")] Io(#[from] io::Error), /// A path escapes the workspace root (e.g. `..`). #[error("path {0} escapes the workspace root")] PathEscape(PathBuf), /// An edit targeted a non-editable component (i.e. /// [`HarnessComponentKind::ShortTermMemory`]). #[error("component {0:?} is not editable")] NotEditable(HarnessComponentKind), /// Edit path does not live under the component's mount point. #[error("path {path:?} does not live under the {kind:?} mount {mount:?}")] MountMismatch { /// The kind whose mount the path was supposed to live under. kind: HarnessComponentKind, /// The path the caller supplied. path: PathBuf, /// The expected mount. mount: PathBuf, }, } Source line 50 #[derive(Debug, Clone)] pub struct HarnessWorkspace { } Source line 56 pub fn open(root: impl Into) -> Result; Source line 64 #[must_use] pub fn root(&self) -> &Path; Source line 71 #[must_use] pub fn mount_path(&self, kind: HarnessComponentKind) -> PathBuf; Source line 77 pub fn read_single_file( &self, kind: HarnessComponentKind, ) -> Result, HarnessWorkspaceError>; Source line 90 pub fn write_single_file( &self, kind: HarnessComponentKind, contents: &str, ) -> Result; Source line 110 pub fn list_directory( &self, kind: HarnessComponentKind, ) -> Result, HarnessWorkspaceError>; Source line 128 pub fn read_directory_file( &self, kind: HarnessComponentKind, path: impl AsRef, ) -> Result, HarnessWorkspaceError>; Source line 143 pub fn apply_edit( &self, edit: &HarnessComponentEdit, ) -> Result; Source line 180 pub fn apply_batch( &self, edits: &[HarnessComponentEdit], ) -> Result, HarnessWorkspaceError>;