pub struct WorkspaceServices { /* private fields */ }Expand description
The host-provided workspace capability bundle used by tool execution.
Implementations§
Source§impl WorkspaceServices
impl WorkspaceServices
pub fn builder( workspace_ref: WorkspaceRef, file_system: Arc<dyn WorkspaceFileSystem>, ) -> WorkspaceServicesBuilder
pub fn local(root: impl Into<PathBuf>) -> Arc<Self> ⓘ
pub fn workspace_ref(&self) -> &WorkspaceRef
pub fn capabilities(&self) -> WorkspaceCapabilities
pub fn normalize_path(&self, input: &str) -> Result<WorkspacePath>
pub fn fs(&self) -> Arc<dyn WorkspaceFileSystem> ⓘ
pub fn command_runner(&self) -> Option<Arc<dyn WorkspaceCommandRunner>>
pub fn search(&self) -> Option<Arc<dyn WorkspaceSearch>>
pub fn git(&self) -> Option<Arc<dyn WorkspaceGit>>
pub fn git_stash(&self) -> Option<Arc<dyn WorkspaceGitStashProvider>>
pub fn git_worktree(&self) -> Option<Arc<dyn WorkspaceGitWorktreeProvider>>
Sourcepub fn operation_timeout(&self) -> Option<Duration>
pub fn operation_timeout(&self) -> Option<Duration>
Default timeout applied to non-bash workspace operations.
None means no enforced timeout. Backends that may stall (remote,
browser, DFS) should set this so tools using Self::run_with_timeout
surface a timeout error instead of letting the agent loop hang.
Sourcepub async fn run_with_timeout<F, T>(
&self,
op: &'static str,
fut: F,
) -> Result<T>
pub async fn run_with_timeout<F, T>( &self, op: &'static str, fut: F, ) -> Result<T>
Run a workspace future under the configured operation timeout.
Tools that route through file system / search / git providers should wrap their calls with this helper so non-local backends never stall the agent loop indefinitely.
pub fn local_root(&self) -> Option<&Path>
pub fn display_path(&self, path: &WorkspacePath) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkspaceServices
impl !RefUnwindSafe for WorkspaceServices
impl Send for WorkspaceServices
impl Sync for WorkspaceServices
impl Unpin for WorkspaceServices
impl UnsafeUnpin for WorkspaceServices
impl !UnwindSafe for WorkspaceServices
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more