pub struct WorkspaceBackend { /* private fields */ }Expand description
File access confined to a Workspace. Every operation re-resolves its
path, so a symlink cannot lead outside the root. It runs no processes;
commands go through crate::Shell and its sandbox.
Implementations§
Trait Implementations§
Source§impl Clone for WorkspaceBackend
impl Clone for WorkspaceBackend
Source§impl Debug for WorkspaceBackend
impl Debug for WorkspaceBackend
Source§impl ExecutionBackend for WorkspaceBackend
impl ExecutionBackend for WorkspaceBackend
fn kind(&self) -> BackendKind
fn id(&self) -> &str
fn approval_scope(&self) -> &str
fn workspace_root(&self) -> &BackendPath
fn home_hint(&self) -> &BackendPath
fn allows_outside_workspace(&self) -> bool
fn home_dir<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BackendPath>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve_path<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<BackendPath>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn canonicalize<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<BackendPath>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<BackendMetadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
content: &'life2 [u8],
mode: WriteMode,
create_parents: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 BackendPath,
destination: &'life2 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 BackendPath,
destination: &'life2 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn remove_empty_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_empty_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a directory only if it is empty; never recursive.
fn read_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<Vec<BackendDirEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spawn<'life0, 'async_trait>(
&'life0 self,
_request: ExecutionRequest,
) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn terminate<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 ProcessHandle,
_grace: Duration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ExecutionRequest,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<ExecutionOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn import_local_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
local_path: &'life1 Path,
destination: &'life2 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<BackendPath>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn import_local_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
local_path: &'life1 Path,
destination: &'life2 BackendPath,
) -> Pin<Box<dyn Future<Output = Result<BackendPath>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copy a daemon-host file into the execution workspace. Local execution
preserves the original path when it is permitted.
Source§fn export_local_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 BackendPath,
local_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn export_local_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source: &'life1 BackendPath,
local_path: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copy an execution-side file to a daemon-host staging path.
Source§fn resolve_executable<'life0, 'life1, 'async_trait>(
&'life0 self,
executable: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BackendPath>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_executable<'life0, 'life1, 'async_trait>(
&'life0 self,
executable: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BackendPath>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve an executable in the same environment used for agent work.
Bare names are checked against PATH first, then against conventional
user-local and system prefixes. The returned path is concrete so callers
do not have to rediscover it through a differently configured shell.
fn executable_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
executable: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Forget for WorkspaceBackend
impl Freeze for WorkspaceBackend
impl Move for WorkspaceBackend
impl RefUnwindSafe for WorkspaceBackend
impl Send for WorkspaceBackend
impl Sync for WorkspaceBackend
impl Unpin for WorkspaceBackend
impl UnsafeUnpin for WorkspaceBackend
impl UnwindSafe for WorkspaceBackend
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