pub struct LocalWorkspace { /* private fields */ }Expand description
Local filesystem workspace
Implementations§
Source§impl LocalWorkspace
impl LocalWorkspace
pub async fn with_path(path: PathBuf) -> WorkspaceResult<Self>
Trait Implementations§
Source§impl Debug for LocalWorkspace
impl Debug for LocalWorkspace
Source§impl Workspace for LocalWorkspace
impl Workspace for LocalWorkspace
Source§fn environment<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EnvironmentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn environment<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EnvironmentInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get environment information for this workspace
Source§fn metadata(&self) -> WorkspaceMetadata
fn metadata(&self) -> WorkspaceMetadata
Get workspace metadata
Source§fn invalidate_environment_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invalidate_environment_cache<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invalidate cached environment information (force refresh on next call)
Source§fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
query: Option<&'life1 str>,
max_results: Option<usize>,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
query: Option<&'life1 str>,
max_results: Option<usize>,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List files in the workspace for fuzzy finding
Returns workspace-relative paths, filtered by optional query
Source§fn working_directory(&self) -> &Path
fn working_directory(&self) -> &Path
Get the working directory for this workspace
Source§fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ReadFileRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<FileContentResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ReadFileRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<FileContentResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read file contents with optional offset/limit.
Source§fn list_directory<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ListDirectoryRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<FileListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_directory<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ListDirectoryRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<FileListResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List a directory (similar to ls).
Source§fn glob<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GlobRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<GlobResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn glob<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GlobRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<GlobResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Apply glob patterns.
Source§fn grep<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GrepRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<SearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn grep<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GrepRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<SearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Text search (grep-style).
Source§fn astgrep<'life0, 'life1, 'async_trait>(
&'life0 self,
request: AstGrepRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<SearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn astgrep<'life0, 'life1, 'async_trait>(
&'life0 self,
request: AstGrepRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<SearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
AST search (astgrep-style).
Source§fn apply_edits<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ApplyEditsRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EditResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_edits<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ApplyEditsRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EditResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Apply one or more edits to a file.
Source§fn write_file<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WriteFileRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EditResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_file<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WriteFileRequest,
ctx: &'life1 WorkspaceOpContext,
) -> Pin<Box<dyn Future<Output = WorkspaceResult<EditResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write/replace entire file content.
Auto Trait Implementations§
impl Freeze for LocalWorkspace
impl !RefUnwindSafe for LocalWorkspace
impl Send for LocalWorkspace
impl Sync for LocalWorkspace
impl Unpin 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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request