pub trait Workspace: Send + Sync {
// Required methods
fn root<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkspaceRoot> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
access: WorkspaceAccess,
) -> Pin<Box<dyn Future<Output = Result<ResolvedPath, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
options: FileReadOptions,
) -> Pin<Box<dyn Future<Output = Result<FileContent, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_file<'life0, 'async_trait>(
&'life0 self,
request: WriteFileRequest,
) -> Pin<Box<dyn Future<Output = Result<FileWriteResult, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_files<'life0, 'async_trait>(
&'life0 self,
query: ListFilesQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceEntry>, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn snapshot<'life0, 'async_trait>(
&'life0 self,
request: SnapshotRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceSnapshot, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn diff<'life0, 'async_trait>(
&'life0 self,
request: DiffRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiff, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn apply_patch<'life0, 'async_trait>(
&'life0 self,
request: PatchRequest,
) -> Pin<Box<dyn Future<Output = Result<PatchResult, WorkspaceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Workspace abstraction for coding workloads.
Required Methods§
Sourcefn root<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkspaceRoot> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn root<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkspaceRoot> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns this workspace’s root.
Sourcefn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
access: WorkspaceAccess,
) -> Pin<Box<dyn Future<Output = Result<ResolvedPath, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
access: WorkspaceAccess,
) -> Pin<Box<dyn Future<Output = Result<ResolvedPath, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolves a root-relative path for a specific access mode.
Sourcefn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
options: FileReadOptions,
) -> Pin<Box<dyn Future<Output = Result<FileContent, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 WorkspacePath,
options: FileReadOptions,
) -> Pin<Box<dyn Future<Output = Result<FileContent, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a file through workspace policy.
Sourcefn write_file<'life0, 'async_trait>(
&'life0 self,
request: WriteFileRequest,
) -> Pin<Box<dyn Future<Output = Result<FileWriteResult, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write_file<'life0, 'async_trait>(
&'life0 self,
request: WriteFileRequest,
) -> Pin<Box<dyn Future<Output = Result<FileWriteResult, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Writes a file through workspace policy.
Sourcefn list_files<'life0, 'async_trait>(
&'life0 self,
query: ListFilesQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceEntry>, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_files<'life0, 'async_trait>(
&'life0 self,
query: ListFilesQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<WorkspaceEntry>, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists files through workspace policy.
Sourcefn snapshot<'life0, 'async_trait>(
&'life0 self,
request: SnapshotRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceSnapshot, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
request: SnapshotRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceSnapshot, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Captures a lightweight snapshot of file versions.
Sourcefn diff<'life0, 'async_trait>(
&'life0 self,
request: DiffRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiff, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn diff<'life0, 'async_trait>(
&'life0 self,
request: DiffRequest,
) -> Pin<Box<dyn Future<Output = Result<WorkspaceDiff, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Diffs two snapshots.
Sourcefn apply_patch<'life0, 'async_trait>(
&'life0 self,
request: PatchRequest,
) -> Pin<Box<dyn Future<Output = Result<PatchResult, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_patch<'life0, 'async_trait>(
&'life0 self,
request: PatchRequest,
) -> Pin<Box<dyn Future<Output = Result<PatchResult, WorkspaceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Applies or dry-runs a structured patch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".