pub trait WorkspaceFileSystem: Send + Sync {
// Required methods
fn read_text<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_text<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceWriteOutcome>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceDirEntry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
File operations available to built-in file tools.
Trait stability policy: new methods added to this trait are a breaking
change for every external backend implementation. Until the workspace
extension story is stabilised, new methods will be added to a separate
WorkspaceFileSystemExt trait (with default implementations that fall back
to the core methods) rather than to this trait directly. Backend authors
can rely on this trait surface remaining additive only through extension
traits.