pub struct FileResource<'a> { /* private fields */ }Expand description
Accessor for the /file endpoints.
Implementations§
Source§impl<'a> FileResource<'a>
impl<'a> FileResource<'a>
Sourcepub async fn read(
&self,
params: &FileReadParams,
) -> Result<FileContent, OpencodeError>
pub async fn read( &self, params: &FileReadParams, ) -> Result<FileContent, OpencodeError>
Read a file’s content.
GET /file/content?path=<path>
Sourcepub async fn list(
&self,
params: Option<&FileListParams>,
) -> Result<Vec<FileNode>, OpencodeError>
pub async fn list( &self, params: Option<&FileListParams>, ) -> Result<Vec<FileNode>, OpencodeError>
List all files in the project directory tree.
GET /file?path=<path>
Sourcepub async fn status(&self) -> Result<FileStatusResponse, OpencodeError>
pub async fn status(&self) -> Result<FileStatusResponse, OpencodeError>
Get the status of all files in the project.
GET /file/status
Auto Trait Implementations§
impl<'a> Freeze for FileResource<'a>
impl<'a> !RefUnwindSafe for FileResource<'a>
impl<'a> Send for FileResource<'a>
impl<'a> Sync for FileResource<'a>
impl<'a> Unpin for FileResource<'a>
impl<'a> !UnwindSafe for FileResource<'a>
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