pub struct LocalWorkspace { /* private fields */ }Expand description
Local filesystem implementation of Workspace.
Implementations§
Source§impl LocalWorkspace
impl LocalWorkspace
Sourcepub fn new(root: impl AsRef<Path>) -> Result<Self, WorkspaceError>
pub fn new(root: impl AsRef<Path>) -> Result<Self, WorkspaceError>
Constructs a local workspace from a root directory.
§Errors
Returns WorkspaceError if the root cannot be canonicalized or is
not an existing directory.
Sourcepub fn with_config(
root: impl AsRef<Path>,
config: LocalWorkspaceConfig,
) -> Result<Self, WorkspaceError>
pub fn with_config( root: impl AsRef<Path>, config: LocalWorkspaceConfig, ) -> Result<Self, WorkspaceError>
Constructs a local workspace with explicit configuration.
§Errors
Returns WorkspaceError if the root cannot be canonicalized or is
not an existing directory.
Sourcepub fn change_tracker(&self) -> AgentChangeTracker
pub fn change_tracker(&self) -> AgentChangeTracker
Returns the local change tracker.
Trait Implementations§
Source§impl Clone for LocalWorkspace
impl Clone for LocalWorkspace
Source§impl Debug for LocalWorkspace
impl Debug for LocalWorkspace
Source§impl Workspace for LocalWorkspace
impl Workspace for LocalWorkspace
Source§fn 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.
Source§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 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.
Source§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 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.
Source§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 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.
Source§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 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.
Source§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 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.
Source§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 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.
Source§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,
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.
Auto Trait Implementations§
impl Freeze for LocalWorkspace
impl RefUnwindSafe for LocalWorkspace
impl Send for LocalWorkspace
impl Sync for LocalWorkspace
impl Unpin for LocalWorkspace
impl UnsafeUnpin for LocalWorkspace
impl UnwindSafe for LocalWorkspace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more